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

PHP Auth\AuthManager类代码示例

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

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



在下文中一共展示了AuthManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * DriversController constructor.
  * @param AuthManager $auth
  * @param User $users
  * @param JsonRespond $jsonRespond
  * @param UserTransformer $userTransformer
  */
 public function __construct(AuthManager $auth, User $users, JsonRespond $jsonRespond, UserTransformer $userTransformer)
 {
     $this->user = $auth->user();
     $this->userTransformer = $userTransformer;
     $this->users = $users;
     parent::__construct($jsonRespond);
 }
开发者ID:GiedriusQ,项目名称:taksistas,代码行数:14,代码来源:DriversController.php


示例2: __construct

 public function __construct(AuthManager $auth, OrderTransformer $orderTransformer, JsonRespond $jsonRespond)
 {
     parent::__construct($jsonRespond);
     $this->user = $auth->user();
     $this->orderTransformer = $orderTransformer;
     $this->jsonRespond = $jsonRespond;
 }
开发者ID:GiedriusQ,项目名称:taksistas,代码行数:7,代码来源:OrdersController.php


示例3: filter

 public function filter(Route $route, Request $request)
 {
     if ($this->auth->check()) {
         $config = $this->config->get('c::redirect-login');
         $url = $config ? $this->url->to($config) : '/';
         return $this->redirect->to($url);
     }
 }
开发者ID:anlutro,项目名称:l4-core,代码行数:8,代码来源:GuestFilter.php


示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param OrderRequest $request
  * @return \Illuminate\Http\Response
  */
 public function store(OrderRequest $request)
 {
     $order = $this->user->createOrder(['status' => 0] + $request->all());
     $order->load('statusHistory');
     $order->assignNearestDriver();
     return $this->jsonRespond->respondModelStore($this->orderTransformer, $order);
 }
开发者ID:GiedriusQ,项目名称:taksistas,代码行数:13,代码来源:OrdersController.php


示例5: handle

 /**
  * Handle an incoming request
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guard()->check()) {
         return $this->redirect->route('admin', $this->app->getLocale());
     }
     return $next($request);
 }
开发者ID:Viktor-V,项目名称:LPanel,代码行数:15,代码来源:IfAuthenticated.php


示例6: auth

 /**
  * Authenticate request.
  *
  * @return bool|exception
  */
 public function auth()
 {
     if (!$this->auth->attempt($this->getCredentials())) {
         throw new InvalidBasicAuthCredentials();
     }
     return true;
 }
开发者ID:devdk,项目名称:signy,代码行数:12,代码来源:Basic.php


示例7: handle

 /**
  * @param $request
  * @param callable $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     if ($this->auth->check()) {
         $this->app->setLocale($this->auth->user()->getLocale());
     }
     return $next($request);
 }
开发者ID:studiocaro,项目名称:HorseStories,代码行数:12,代码来源:Locale.php


示例8: allowedToEdit

 /**
  * Returns whether the logged in user is allowed to edit a page.
  *
  * @return bool
  */
 public function allowedToEdit(Page $page = null)
 {
     if ($page === null) {
         return true;
     }
     return Editor::isEnabled() && $this->auth->check('edit', $page);
 }
开发者ID:imanghafoori1,项目名称:boom-core,代码行数:12,代码来源:Provider.php


示例9: getIndex

 public function getIndex()
 {
     $user = $this->auth->user();
     $threads = $this->threadRepository->getRecentByMember($user);
     $replies = $this->replyRepository->getRecentByMember($user);
     $this->render('dashboard.index', compact('user', 'threads', 'replies'));
 }
开发者ID:sdlyhu,项目名称:laravelio,代码行数:7,代码来源:DashboardController.php


示例10: postFork

 public function postFork($hash)
 {
     $parent = $this->repository->getByHash($hash);
     $command = new Commands\CreateForkCommand($this->request->get('code'), $this->auth->user(), $parent);
     $fork = $this->bus->execute($command);
     return $this->redirector->action('BinController@getShow', [$fork->hash]);
 }
开发者ID:sdlyhu,项目名称:laravelio,代码行数:7,代码来源:BinController.php


示例11: authenticate

 /**
  * Authenticate request with Basic.
  *
  * @param \Illuminate\Http\Request  $request
  * @param \Illuminate\Routing\Route $route
  *
  * @return mixed
  */
 public function authenticate(Request $request, Route $route)
 {
     $this->validateAuthorizationHeader($request);
     if ($user = $this->auth->getUser()) {
         return $user;
     }
     throw new UnauthorizedHttpException(null, 'Please log in before perform this query.');
 }
开发者ID:skimia,项目名称:api-fusion,代码行数:16,代码来源:Sentinel.php


示例12: getUser

 /**
  * Get User
  *
  * @return \Illuminate\Contracts\Auth\Authenticatable
  */
 protected function getUser()
 {
     if (!$this->user) {
         $authGuard = $this->config->get('nwlaravel.activity.auth_guard') ?: $this->auth->getDefaultDriver();
         $this->user = $this->auth->guard($authGuard)->user();
     }
     return $this->user;
 }
开发者ID:naturalweb,项目名称:nwlaravel,代码行数:13,代码来源:ActivityManager.php


示例13: create

 /**
  * @param array $data
  * @return \HorseStories\Models\Events\Event
  */
 public function create($data = [])
 {
     $event = new Event();
     $event->name = $data['event_name'];
     $event->creator_id = $this->auth->user()->id;
     $event->save();
     return $event;
 }
开发者ID:studiocaro,项目名称:HorseStories,代码行数:12,代码来源:EventCreator.php


示例14: compose

 /**
  * composing the view
  *
  * @param \Illuminate\View\View $view
  */
 public function compose(\Illuminate\View\View $view)
 {
     $notifications = [];
     if (null !== ($user = $this->authManager->user())) {
         $notifications = $this->notificationManager->getForUser($user, [NotificationActivity::CREATED, NotificationActivity::READ]);
     }
     $view->with('notifications', $notifications);
 }
开发者ID:ipunkt,项目名称:laravel-notify,代码行数:13,代码来源:ViewComposer.php


示例15: authenticate

 /**
  * Authenticate request with Basic.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Illuminate\Routing\Route  $route
  * @return mixed
  */
 public function authenticate(Request $request, Route $route)
 {
     $this->validateAuthorizationHeader($request);
     if ($response = $this->auth->onceBasic($this->identifier) and $response->getStatusCode() === 401) {
         throw new UnauthorizedHttpException('Basic', 'Invalid authentication credentials.');
     }
     return $this->auth->user();
 }
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:15,代码来源:BasicProvider.php


示例16: postDelete

 public function postDelete($replyId)
 {
     $reply = $this->replies->requireById($replyId);
     $thread = $reply->thread;
     $command = new Commands\DeleteReplyCommand($reply, $this->auth->user());
     $reply = $this->bus->execute($command);
     return $this->redirector->action('ForumController@getViewThread', [$thread->slug]);
 }
开发者ID:sdlyhu,项目名称:laravelio,代码行数:8,代码来源:ForumRepliesController.php


示例17: getPreparedRules

 /**
  * Get the prepared validation rules.
  *
  * @return array
  */
 protected function getPreparedRules()
 {
     $forbidden = implode(',', $this->config->get('config.forbidden_usernames', []));
     $userId = $this->auth->user()->id;
     $this->rules['username'] .= '|not_in:' . $forbidden;
     $this->rules['username'] .= '|unique:users,username,' . $userId;
     return $this->rules;
 }
开发者ID:wmk223,项目名称:site,代码行数:13,代码来源:SettingsForm.php


示例18: collect

 /**
  * @{inheritDoc}
  */
 public function collect()
 {
     try {
         $user = $this->auth->user();
     } catch (\Exception $e) {
         $user = null;
     }
     return $this->getUserInformation($user);
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:12,代码来源:AuthCollector.php


示例19: create

 /**
  * @param \HorseStories\Models\Statuses\Status $status
  * @param string $body
  * @return \HorseStories\Models\Comments\Comment
  */
 public function create(Status $status, $body)
 {
     $comment = new Comment();
     $comment->status_id = $status->id;
     $comment->body = $body;
     $comment->user_id = $this->auth->user()->id;
     $comment->save();
     return $comment;
 }
开发者ID:studiocaro,项目名称:HorseStories,代码行数:14,代码来源:CommentCreator.php


示例20: index

 /**
  * Confirm user with token.
  * 
  * @param  string $token
  * @return Response
  */
 public function index($token)
 {
     $user = $this->userRepo->getByConfirmationToken($token);
     if (!$user) {
         return view('auth.confirm')->withBadToken(true);
     }
     $user->confirm();
     $this->auth->login($user);
     return redirect('/');
 }
开发者ID:adriancatalinsv,项目名称:fiip,代码行数:16,代码来源:ConfirmationController.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Auth\Guard类代码示例发布时间:2022-05-23
下一篇:
PHP Entities\User类代码示例发布时间: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