public function _init($data = array()) { parent::_init($data); if (!isset($data['id'])) { $this->set_id(0); } }
public function store(Request $request) { $attributeSetID = \Input::get('attribute_set_id', 0); $behaviorDO = new CreateBehaviorDO($request->all()); $behaviorDO->update(array('store_id' => $this->store->id, 'attribute_set_id' => $attributeSetID)); $this->createBehavior->handle($behaviorDO); return redirect(route($this->baseRoute . 'index', $this->store->id->value()))->with('status', 'Продуктът е създаден!'); }