layout)) { $this->layout = View::make($this->layout); } } protected function authorizeCreate() { $this->authorize('create', $this->entity); } protected function authorizeUpdate($input){ $creating = empty($input['public_id']) || $input['public_id'] == '-1'; if($creating){ $this->authorize('create', $this->entity); } else{ $className = Utils::getEntityName($this->entity); $object = call_user_func(array("App\\Models\\{$className}", 'scope'), $input['public_id'])->firstOrFail(); $this->authorize('edit', $object); } } }