App\Http\Controllers\BaseAPIController::__construct PHP Method

__construct() public method

public __construct ( )
    public function __construct()
    {
        $this->manager = new Manager();
        if ($include = Request::get('include')) {
            $this->manager->parseIncludes($include);
        }
        $this->serializer = Request::get('serializer') ?: API_SERIALIZER_ARRAY;
        if ($this->serializer === API_SERIALIZER_JSON) {
            $this->manager->setSerializer(new JsonApiSerializer());
        } else {
            $this->manager->setSerializer(new ArraySerializer());
        }
    }

Usage Example

 public function __construct(InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, Mailer $mailer)
 {
     parent::__construct();
     $this->invoiceRepo = $invoiceRepo;
     $this->clientRepo = $clientRepo;
     $this->mailer = $mailer;
 }
All Usage Examples Of App\Http\Controllers\BaseAPIController::__construct