• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Controllers\Controller类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中App\Http\Controllers\Controller的典型用法代码示例。如果您正苦于以下问题:PHP Controller类的具体用法?PHP Controller怎么用?PHP Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Controller类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:anruence,项目名称:project-flyer,代码行数:10,代码来源:FlyersController.php


示例2: showCreateFrom

 public function showCreateFrom()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     return Controller::myView('admin_book.post');
 }
开发者ID:TrinhKien94,项目名称:ttt,代码行数:7,代码来源:AddBookController.php


示例3: __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();
 }
开发者ID:litecms,项目名称:pricelist,代码行数:14,代码来源:PriceListController.php


示例4: __construct

 public function __construct(PartRepositoryEloquent $partRepo, TireSensorRepositoryEloquent $tireSensorRepo)
 {
     parent::__construct();
     $this->middleware('auth');
     $this->partRepo = $partRepo;
     $this->tireSensorRepo = $tireSensorRepo;
 }
开发者ID:alientronics,项目名称:fleetany-web,代码行数:7,代码来源:TireController.php


示例5: __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();
 }
开发者ID:nicsmyrn,项目名称:library,代码行数:11,代码来源:BooksController.php


示例6: __construct

public function __construct()
	{
$this->middleware('auth');
//$this->user = Auth::user();
parent::__construct();

	}
开发者ID:RybinDen,项目名称:laravel-blog,代码行数:7,代码来源:HomeController.php


示例7: __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();
 }
开发者ID:santoshpawar,项目名称:laravel-5-simple-cms,代码行数:11,代码来源:DataTableController.php


示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->roleModel = new Role();
     $this->appModel = new App();
     $this->authModel = new Auth();
 }
开发者ID:xxtime,项目名称:boss,代码行数:7,代码来源:RoleController.php


示例9: __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();
 }
开发者ID:backstagetechnicalservices,项目名称:website,代码行数:10,代码来源:MembersController.php


示例10: __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']);
 }
开发者ID:kpaxer,项目名称:shcms,代码行数:14,代码来源:AuthController.php


示例11: __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();
 }
开发者ID:lavalite,项目名称:cms,代码行数:7,代码来源:UserApiController.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     if (\Session::has('admin.username')) {
         $this->userid = \Session::get('admin.adminid');
     }
 }
开发者ID:946493655,项目名称:culture,代码行数:7,代码来源:BaseController.php


示例13: __construct

 public function __construct()
 {
     Stripe::setApiVersion(config('services.stripe.api_version'));
     $this->middleware('auth');
     $this->postman = new Postman();
     parent::__construct();
 }
开发者ID:WendyMcF,项目名称:Sidequest,代码行数:7,代码来源:SubscriptionController.php


示例14:

 function __construct()
 {
     parent::__construct();
     if (!$this->isAdmin($this->getLoggedInUser())) {
         throw new \Exception("Not allowed, only admin has access", 401);
     }
 }
开发者ID:thabung,项目名称:serveaseme,代码行数:7,代码来源:AdminController.php


示例15: __construct

 public function __construct(UserRepository $user, RoleRepository $role, PermissionRepository $perms)
 {
     parent::__construct();
     $this->user = $user;
     $this->role = $role;
     $this->permission = $perms;
 }
开发者ID:vnzacky,项目名称:dog,代码行数:7,代码来源:UserController.php


示例16: __construct

 public function __construct(Request $request)
 {
     parent::__construct($request);
     if (Auth::user()->role != "supadmin") {
         abort(402, "Unauthorized");
     }
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:7,代码来源:CompaniesController.php


示例17: __construct

 public function __construct(ProfileService $profileService, UserRepo $userRepo, SaleRepo $saleRepo)
 {
     $this->profileService = $profileService;
     $this->userRepo = $userRepo;
     $this->saleRepo = $saleRepo;
     parent::__construct();
 }
开发者ID:arjayads,项目名称:green-tracker,代码行数:7,代码来源:ProfileController.php


示例18: __construct

 /**
  * @param Permission $permission
  * @param Role $role
  * @param Route $route
  */
 public function __construct(Application $app, Audit $audit, Permission $permission, Role $role, Route $route)
 {
     parent::__construct($app, $audit);
     $this->permission = $permission;
     $this->role = $role;
     $this->route = $route;
 }
开发者ID:sroutier,项目名称:laravel-5.1-enterprise-starter-kit,代码行数:12,代码来源:PermissionsController.php


示例19: __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();
 }
开发者ID:valdinei,项目名称:rest,代码行数:13,代码来源:PasswordController.php


示例20: __construct

public function __construct(){
$this->middleware('auth',[
'except' => [
'getIndex','show'
]]);
parent::__construct();
}
开发者ID:RybinDen,项目名称:laravel-blog,代码行数:7,代码来源:TegController.php



注:本文中的App\Http\Controllers\Controller类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Controllers\DB类代码示例发布时间:2022-05-23
下一篇:
PHP Controllers\BaseController类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap