本文整理汇总了PHP中App\Http\Controllers\Controller::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::__construct方法的具体用法?PHP Controller::__construct怎么用?PHP Controller::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Controllers\Controller
的用法示例。
在下文中一共展示了Controller::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->page['title'] = trans('admin.manager_menu');
$this->model = new Menu();
$this->lang = Lang::getLocale();
}
示例2: __construct
public function __construct(PartRepositoryEloquent $partRepo, TireSensorRepositoryEloquent $tireSensorRepo)
{
parent::__construct();
$this->middleware('auth');
$this->partRepo = $partRepo;
$this->tireSensorRepo = $tireSensorRepo;
}
示例3: __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();
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->middleware('auth', ['except' => ['index', 'show']]);
$user = Sentinel::getUser();
PostService::setUser($user);
}
示例5: __construct
/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public function __construct(Registrar $registrar, Auth $auth, Socialite $socialite, SocialUserRepository $socialUsers)
{
parent::__construct();
$this->resolve();
$this->loginPath = route('auth.login');
$this->middleware('guest', ['except' => 'getLogout']);
}
示例6: __construct
public function __construct(ProfileService $profileService, UserRepo $userRepo, SaleRepo $saleRepo)
{
$this->profileService = $profileService;
$this->userRepo = $userRepo;
$this->saleRepo = $saleRepo;
parent::__construct();
}
示例7: __construct
/**
* Create a new password controller instance.
*
* @param Guard $auth
* @param PasswordBroker $passwords
*/
public function __construct(Guard $auth, PasswordBroker $passwords)
{
$this->auth = $auth;
$this->passwords = $passwords;
$this->middleware('guest');
parent::__construct();
}
示例8:
function __construct()
{
parent::__construct();
if (!$this->isAdmin($this->getLoggedInUser())) {
throw new \Exception("Not allowed, only admin has access", 401);
}
}
示例9: __construct
public function __construct()
{
parent::__construct();
if (\Session::has('admin.username')) {
$this->userid = \Session::get('admin.adminid');
}
}
示例10: __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();
}
示例11: __construct
public function __construct(UserRepository $user, RoleRepository $role, PermissionRepository $perms)
{
parent::__construct();
$this->user = $user;
$this->role = $role;
$this->permission = $perms;
}
示例12: __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();
}
示例13: __construct
public function __construct()
{
$this->middleware('auth', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
$this->middleware('check-user-restricted', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
$this->middleware('verify-user', ['only' => ['getInvoice', 'getCheckout', 'postCheckout', 'postUpdateAddress']]);
return parent::__construct();
}
示例14: __construct
public function __construct()
{
$this->middleware('auth', ['except' => ['index', 'show']]);
$this->middleware('author:article', ['except' => ['index', 'show', 'create']]);
view()->share('allTags', Tag::with('articles')->get());
parent::__construct();
}
示例15: __construct
public function __construct()
{
$this->middleware('auth', ['only' => ['store']]);
// $this->middleware('cachebefore', ['only' => ['show', 'showAjax']]);
// $this->middleware('cacheafter', ['only' => ['show', 'showAjax']]);
parent::__construct();
}