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