本文整理汇总了PHP中App\Http\Controllers\BaseController类的典型用法代码示例。如果您正苦于以下问题:PHP BaseController类的具体用法?PHP BaseController怎么用?PHP BaseController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
\App\Http\Controllers\BaseController::setHeader();
/**
* Handle Service Exceptions
*/
if ($e instanceof \App\Exceptions\ServiceException) {
$response = array('status' => $e->getCode(), 'message' => $e->getMessage());
ServiceLog::requestLog($request, $response);
return \Response::json($response);
}
if (!\Config::get('app.debug')) {
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
if ($e instanceof \Illuminate\Contracts\Container\BindingResolutionException) {
$response = array('status' => 604, 'message' => '相应服务没有启动');
} elseif ($e instanceof \Symfony\Component\Debug\Exception\FatalErrorException) {
$response = array('status' => 605, 'message' => 'method wrong');
} else {
$response = array('status' => $e->getCode() ?: 606, 'message' => $e->getMessage() ?: '请检查请求数据');
}
ServiceLog::errorLog($request, $response);
return \Response::json($response);
}
return parent::render($request, $e);
}
示例2: __construct
public function __construct(AccountRepository $accountRepo, ContactMailer $contactMailer, UserMailer $userMailer)
{
parent::__construct();
$this->accountRepo = $accountRepo;
$this->contactMailer = $contactMailer;
$this->userMailer = $userMailer;
}
示例3: __construct
public function __construct()
{
parent::__construct();
//redis db selection - please note this is to be changed for different states when it is applied
//for now we are only considering CA state code so redis db = 5 as static
$this->redisDb = 6;
}
示例4: __construct
public function __construct(TaskRepository $taskRepo, InvoiceRepository $invoiceRepo, TaskService $taskService)
{
parent::__construct();
$this->taskRepo = $taskRepo;
$this->invoiceRepo = $invoiceRepo;
$this->taskService = $taskService;
}
示例5: __construct
public function __construct(AccountRepository $accountRepo, Mailer $mailer, EmailService $emailService)
{
parent::__construct();
$this->accountRepo = $accountRepo;
$this->mailer = $mailer;
$this->emailService = $emailService;
}
示例6: __construct
/**
* Create a new authentication controller instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->middleware('guest', ['except' => 'getLogout']);
$popup = Popup::where('status', 1)->first();
view()->share('popup', $popup);
}
示例7: __construct
public function __construct(Model $model, $base = 'jabatan')
{
parent::__construct($model, $base);
view()->share('breadcrumb2Icon', 'tag');
view()->share('fields', ['id' => 'ID', 'jabatan' => 'Jabatan', 'status' => 'Status']);
view()->share('unsortables', ['status']);
}
示例8: __construct
public function __construct(Model $model, $base = 'profile')
{
parent::__construct($model, $base);
view()->share('breadcrumb2Icon', 'image');
view()->share('noAddButton', true);
view()->share('withoutMenu', true);
}
示例9: __construct
/**
* Create a new BrowseController instance.
*
* @param \App\Repositories\CategoryRepositoryInterface $categories
* @param \App\Repositories\TagRepositoryInterface $tags
* @param \App\Repositories\TrickRepositoryInterface $tricks
*/
public function __construct(CategoryRepositoryInterface $categories, TagRepositoryInterface $tags, TrickRepositoryInterface $tricks)
{
parent::__construct();
$this->categories = $categories;
$this->tags = $tags;
$this->tricks = $tricks;
}
示例10: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$this->modelName = 'Sacramento';
$this->collectionName = 'sacramentos';
$this->folder = 'sacramentos';
}
示例11: __construct
public function __construct(Mailer $mailer, InvoiceRepository $invoiceRepo, ClientRepository $clientRepo)
{
parent::__construct();
$this->mailer = $mailer;
$this->invoiceRepo = $invoiceRepo;
$this->clientRepo = $clientRepo;
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->page_attributes->page_title = 'Perusahaan';
$this->page_attributes->breadcrumb = [];
$this->middleware('password.needed', ['only' => ['destroy']]);
}
示例13: __construct
/**
*
*/
public function __construct()
{
parent::__construct();
$this->dishes = User::find(Auth::id())->dishes->lists('name', 'id')->toArray();
$this->ingredients = User::find(Auth::id())->ingredients->lists('name', 'id')->toArray();
\View::share('dishes', $this->dishes);
\View::share('ingredients', $this->ingredients);
}
示例14:
function __construct()
{
parent::__construct();
Session::set('API_token', Session::get('API_token_public'));
$this->page_attributes->title = 'BALIN.ID';
$this->page_attributes->source = 'web_v2.pages.info.';
$this->page_attributes->breadcrumb = [];
}
示例15: __construct
public function __construct(UserAuthentication $userAuth, Dispatcher $dispatcher)
{
$this->userAuth = $userAuth;
$this->middleware('guest', ['only' => ['registerAjax', 'loginAjax']]);
$this->domain = 'Main Domain';
$this->ajaxAuth = true;
parent::__construct($dispatcher);
}