Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController::__construct PHP Метод

__construct() публичный Метод

public __construct ( )
    public function __construct()
    {
        $serializedApiMethods = serialize($this->apiMethods);
        // Launch middleware
        $this->middleware('apiguard:' . $serializedApiMethods);
        // Attempt to get an authenticated user.
        $this->user = ApiGuardAuth::getUser();
        $this->response = ApiResponseBuilder::build();
    }

Usage Example

 /**
  * 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;
 }
All Usage Examples Of Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController::__construct
ApiGuardController