コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
ファイル: UsersController.php プロジェクト: nerea91/laravel
 /**
  * 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);
 }
コード例 #4
0
 /**
  * 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);
 }
コード例 #5
0
ファイル: IssueController.php プロジェクト: NukaCode/Miranda
 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']);
 }
コード例 #6
0
 /**
  * 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']];
 }
コード例 #7
0
 /**
  * Class constructor.
  *
  * @param  Model
  * @return void
  */
 public function __construct(Model $resource)
 {
     parent::__construct($resource);
 }
コード例 #8
0
ファイル: UserController.php プロジェクト: superdol/Wiki
 /**
  * Class constructor.
  *
  * @param  Model
  * @return void
  */
 public function __construct(Model $resource)
 {
     parent::__construct($resource);
     $this->setEagerLoadedRelationships('language', 'provider', 'role');
 }
コード例 #9
0
 public function __construct(Project $project)
 {
     parent::__construct();
     $this->model = $project;
     $this->setBreadCrumbs(['List' => 'project.index', 'Create' => 'project.create']);
 }
コード例 #10
0
 /**
  * Class constructor.
  *
  * @param  Model
  * @return void
  */
 public function __construct(Model $resource)
 {
     parent::__construct($resource);
     $this->setEagerLoadedRelationships('category');
 }