/** * Class constructor. * * @param App\Model $resource Instance of the resource this controller is in charge of. * * @return void */ public function __construct(AuthProvider $resource) { $user = auth()->user() ?: new User(); // Fallback for `php artisan route:list` to work $permissions = ['view' => $user->hasPermission(80), 'add' => $user->hasPermission(81), 'edit' => $user->hasPermission(82), 'delete' => $user->hasPermission(83), 'viewAccount' => $user->hasPermission(100) and $this->with[] = 'accounts']; parent::__construct($resource, $permissions); }
/** * Class constructor. * * @param App\Model $resource Instance of the resource this controller is in charge of. * * @return void */ public function __construct(Currency $resource) { $user = auth()->user() ?: new User(); // Fallback for `php artisan route:list` to work $permissions = ['view' => $user->hasPermission(120), 'add' => $user->hasPermission(121), 'edit' => $user->hasPermission(122), 'delete' => $user->hasPermission(123), 'viewCountry' => $user->hasPermission(10)]; parent::__construct($resource, $permissions); }
/** * Class constructor. * * @param App\Model $resource Instance of the resource this controller is in charge of. * * @return void */ public function __construct(User $resource) { $user = auth()->user() ?: new User(); // Fallback for `php artisan route:list` to work $permissions = ['view' => $user->hasPermission(60), 'add' => $user->hasPermission(61), 'edit' => $user->hasPermission(62), 'delete' => $user->hasPermission(63), 'viewAccount' => $user->hasPermission(100), 'viewCountry' => $user->hasPermission(10) and $this->with[] = 'country', 'viewLanguage' => $user->hasPermission(20), 'viewProfile' => $user->hasPermission(40) and $this->with[] = 'profile']; parent::__construct($resource, $permissions); }
/** * Class constructor. * * @param App\Model $resource Instance of the resource this controller is in charge of. * * @return void */ public function __construct(Language $resource) { $user = auth()->user() ?: new User(); // Fallback for `php artisan route:list` to work $permissions = ['view' => $user->hasPermission(20), 'add' => $user->hasPermission(21), 'edit' => $user->hasPermission(22), 'delete' => $user->hasPermission(23), 'viewUser' => $user->hasPermission(10) and $this->with[] = 'users']; parent::__construct($resource, $permissions); }
public function __construct(Issue $issue) { parent::__construct(); $this->model = $issue; $faker = \Faker\Factory::create(); $this->setViewData(compact('faker')); $this->setBreadCrumbs(['All Issues' => 'issue.index', 'New Issue' => 'issue.create']); }
/** * Class constructor. * * @param App\Model $resource Instance of the resource this controller is in charge of. * * @return void */ public function __construct(Document $resource) { $user = auth()->user() ?: new User(); // Fallback for `php artisan route:list` to work $permissions = ['view' => $user->hasPermission(140), 'add' => $user->hasPermission(141), 'edit' => $user->hasPermission(142), 'delete' => $user->hasPermission(143), 'viewProfile' => $user->hasPermission(40) and $this->with[] = 'profiles']; parent::__construct($resource, $permissions); // Relationships to validate when saving resource $this->relationships = ['profiles' => [_('Profiles'), 'required|array|min:1']]; }
/** * Class constructor. * * @param Model * @return void */ public function __construct(Model $resource) { parent::__construct($resource); }
/** * Class constructor. * * @param Model * @return void */ public function __construct(Model $resource) { parent::__construct($resource); $this->setEagerLoadedRelationships('language', 'provider', 'role'); }
public function __construct(Project $project) { parent::__construct(); $this->model = $project; $this->setBreadCrumbs(['List' => 'project.index', 'Create' => 'project.create']); }
/** * Class constructor. * * @param Model * @return void */ public function __construct(Model $resource) { parent::__construct($resource); $this->setEagerLoadedRelationships('category'); }