Наследование: extends Illuminate\Routing\Controller
 /**
  * VideoController constructor.
  *
  * @param VideoTransformer $videoTransformer
  * @param Video            $video
  * @param User             $user
  */
 public function __construct(Video $video, User $user, VideoTransformer $videoTransformer)
 {
     parent::__construct();
     $this->videoTransformer = $videoTransformer;
     $this->video = $video;
     $this->user = $user;
 }
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct(Request $request)
 {
     // check for an access token in header - if
     // it doesn't exist, use adminauth middleware
     $key = $request->header(Config::get('apiguard.keyName', 'X-Authorization'));
     if ($key) {
         // construct parent (ApiGuard Controller)
         parent::__construct();
     } else {
         $this->middleware('adminauth');
     }
 }
Пример #3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->response = \Response::api();
     if (!empty($this->modelName)) {
         $this->model = new $this->modelName();
     }
     // if no collection name provided, use the model's table name
     if (empty($this->collectionName)) {
         $this->collectionName = $this->model->getTable();
     }
     // parse includes
     if (\Input::get('include') != '') {
         $this->manager = new \League\Fractal\Manager();
         $this->manager->parseIncludes(explode(',', \Input::get('include')));
     }
     parent::__construct();
 }
 /**
  * CommentController constructor.
  *
  * @param Comment            $comment
  * @param CommentTransformer $commentTransformer
  */
 public function __construct(Comment $comment, CommentTransformer $commentTransformer)
 {
     parent::__construct();
     $this->commentTransformer = $commentTransformer;
     $this->comment = $comment;
 }
Пример #5
0
 /**
  * UserController constructor.
  *
  * @param User            $user
  * @param UserTransformer $userTransformer
  */
 public function __construct(User $user, UserTransformer $userTransformer)
 {
     parent::__construct();
     $this->userTransformer = $userTransformer;
     $this->user = $user;
 }
Пример #6
0
 /**
  * PostController constructor.
  *
  * @param PostService $postService
  * @param Response    $response
  * @param Post        $post
  */
 public function __construct(PostService $postService, Response $response, Post $post)
 {
     parent::__construct();
     $this->postService = $postService;
     $this->post = $post;
 }
Пример #7
0
 /**
  * @param ApiService $api
  * @param Response   $response
  */
 public function __construct(ApiService $api, Response $response)
 {
     parent::__construct();
     $this->api = $api;
     $this->response = $response;
 }
 /**
  * @param CountryService $country
  * @param Response       $response
  */
 public function __construct(CountryService $country, Response $response)
 {
     parent::__construct();
     $this->country = $country;
     $this->response = $response;
 }
 /**
  * LikeDislikeController constructor.
  *
  * @param LikeDislike            $likeDislike
  * @param LikeDislikeTransformer $likeDislikeTransformer
  */
 public function __construct(LikeDislike $likeDislike, LikeDislikeTransformer $likeDislikeTransformer)
 {
     parent::__construct();
     $this->likeDislikeTransformer = $likeDislikeTransformer;
     $this->likeDislike = $likeDislike;
 }