本文整理匯總了PHP中App\Http\Controllers\Controller類的典型用法代碼示例。如果您正苦於以下問題:PHP Controller類的具體用法?PHP Controller怎麽用?PHP Controller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Controller類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* FlyersController constructor.
*/
public function __construct()
{
// everybody must be authenticated to access the methods
// except for the show method
$this->middleware('auth', ['except' => ['show']]);
parent::__construct();
}
示例2: __construct
/**
* Constructor.
*
* @param type \Litecms\PriceList\Interfaces\PriceListRepositoryInterface $pricelist
*
* @return type
*/
public function __construct(PriceListRepositoryInterface $pricelist)
{
$this->repository = $pricelist;
$this->middleware('web');
$this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout'));
parent::__construct();
}
示例3: __construct
public function __construct(PartRepositoryEloquent $partRepo, TireSensorRepositoryEloquent $tireSensorRepo)
{
parent::__construct();
$this->middleware('auth');
$this->partRepo = $partRepo;
$this->tireSensorRepo = $tireSensorRepo;
}
示例4: __construct
/**
* @param DbBookRepository $bookRepository
* @param AjaxBookRepository $ajaxRepository
*/
public function __construct(DbBookRepository $bookRepository, AjaxBookRepository $ajaxRepository)
{
$this->middleware('acl:create_book', ['only' => ['index', 'create', 'store', 'edit', 'update', 'ajaxSearchISBN']]);
$this->book = $bookRepository;
$this->ajax = $ajaxRepository;
parent::__construct();
}
示例5: __construct
public function __construct()
{
$this->middleware('auth');
//$this->user = Auth::user();
parent::__construct();
}
示例6: __construct
/**
* Abort if request is not ajax
* @param Request $request
*/
public function __construct(Request $request)
{
if (!$request->ajax() || !Datatable::shouldHandle()) {
abort(403, 'Forbidden');
}
parent::__construct();
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->roleModel = new Role();
$this->appModel = new App();
$this->authModel = new Auth();
}
示例8: __construct
/**
* Add the permissions requirements for each route.
*/
public function __construct()
{
// Require authentication
$this->middleware('auth.permission:member', ['except' => ['dash', 'getMyProfile', 'postMyProfile', 'updatePassword', 'dashSU', 'profile']]);
$this->middleware('auth', ['only' => ['dash', 'dashSU', 'getMyProfile', 'postMyProfile', 'updatePassword', 'profile']]);
parent::__construct();
}
示例9: __construct
/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public function __construct(Guard $auth, Registrar $registrar)
{
parent::__construct();
$this->auth = $auth;
$this->registrar = $registrar;
$this->middleware('guest', ['except' => 'getLogout']);
}
示例10: __construct
public function __construct()
{
$this->middleware('api');
$this->middleware('jwt.auth:api');
$this->setupTheme(config('theme.themes.user.theme'), config('theme.themes.user.layout'));
parent::__construct();
}
示例11: __construct
public function __construct()
{
parent::__construct();
if (\Session::has('admin.username')) {
$this->userid = \Session::get('admin.adminid');
}
}
示例12: __construct
public function __construct()
{
Stripe::setApiVersion(config('services.stripe.api_version'));
$this->middleware('auth');
$this->postman = new Postman();
parent::__construct();
}
示例13:
function __construct()
{
parent::__construct();
if (!$this->isAdmin($this->getLoggedInUser())) {
throw new \Exception("Not allowed, only admin has access", 401);
}
}
示例14: __construct
public function __construct(UserRepository $user, RoleRepository $role, PermissionRepository $perms)
{
parent::__construct();
$this->user = $user;
$this->role = $role;
$this->permission = $perms;
}
示例15: __construct
public function __construct(Request $request)
{
parent::__construct($request);
if (Auth::user()->role != "supadmin") {
abort(402, "Unauthorized");
}
}