當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::guest方法代碼示例

本文整理匯總了PHP中App\Http\Controllers\Auth::guest方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::guest方法的具體用法?PHP Auth::guest怎麽用?PHP Auth::guest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\Http\Controllers\Auth的用法示例。


在下文中一共展示了Auth::guest方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMultiple

 public function getMultiple()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     return view('send/multiple');
 }
開發者ID:viliguravlad,項目名稱:tokarevsg,代碼行數:7,代碼來源:SendController.php

示例2: getRegister

 public function getRegister()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     return view('admin/register');
 }
開發者ID:viliguravlad,項目名稱:tokarevsg,代碼行數:7,代碼來源:AdminController.php

示例3: view_product

 public function view_product()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     return view('backoffice.cart_view_products');
 }
開發者ID:AsyncIT,項目名稱:iCart,代碼行數:7,代碼來源:adminController.php

示例4: index

 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     if (\Auth::guest()) {
         return redirect()->action('HomeController@index');
     }
     return redirect('auth/login');
 }
開發者ID:clubttt,項目名稱:ProjectHealth,代碼行數:12,代碼來源:WelcomeController.php

示例5: registerForm

 public function registerForm()
 {
     if (!\Auth::guest()) {
         return redirect('/');
     }
     return view('auth.register');
 }
開發者ID:ndrx-io,項目名稱:elude,代碼行數:7,代碼來源:Register.php

示例6: loginForm

 /**
  * @author LAHAXE Arnaud
  *
  *
  * @return $this|\Illuminate\Http\RedirectResponse|\Laravel\Lumen\Http\Redirector
  */
 public function loginForm()
 {
     if (!\Auth::guest()) {
         return redirect('/');
     }
     return view('auth.login', ['googleOauth' => env('GOOGLE_OAUTH_ENABLED')]);
 }
開發者ID:ndrx-io,項目名稱:elude,代碼行數:13,代碼來源:Auth.php

示例7: register

 public function register()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     return \Auth::user()->name;
     return view('Pages.register');
 }
開發者ID:AsyncIT,項目名稱:iCart,代碼行數:8,代碼來源:UserController.php

示例8: header

 public static function header()
 {
     if (\Auth::guest()) {
         $count = null;
     } else {
         $count = FollowController::getCounter(\Auth::user()->name);
     }
     return $count;
 }
開發者ID:GoobyeEarth,項目名稱:abetter,代碼行數:9,代碼來源:CommentsController.php

示例9: __construct

 public function __construct()
 {
     dd('sss');
     if (\Auth::guest()) {
         Session::flash('flash_message', 'You need to log in');
         // dd(\Session::all());
         return \Redirect::to('index');
     }
 }
開發者ID:aleximillers,項目名稱:estore-laravel-angular,代碼行數:9,代碼來源:OrderController.php

示例10: info

 public function info()
 {
     if (\Auth::guest()) {
         return view('/');
     }
     $id = \Auth::user()->id;
     $languages = \App\languages::all();
     $courses = \App\courses::all();
     return view('info')->with(compact('languages'))->with(compact('courses'));
 }
開發者ID:kdymowski,項目名稱:finalProject,代碼行數:10,代碼來源:PagesController.php

示例11: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     if (\Auth::check() && \Auth::user()->name === 'admin') {
         return view('admin/main');
     }
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     return view('home');
 }
開發者ID:viliguravlad,項目名稱:tokarevsg,代碼行數:15,代碼來源:HomeController.php

示例12: update

 /**
  * Update the post in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update($id, Requests\PhotosRequest $request)
 {
     if (\Auth::guest()) {
         return redirect('/');
     }
     $photo = \App\Photo::findorFail($id);
     $photo->update($request->all());
     session()->flash('flash_message', 'Photo Successfully Saved!');
     return redirect('photos/' . $photo->blog_id . '');
 }
開發者ID:Gadurp1,項目名稱:GetRealClothing,代碼行數:17,代碼來源:PhotosController.php

示例13: update

 public function update($id, ArticleRequest $request)
 {
     if (\Auth::guest()) {
         return redirect('article');
     }
     $article = Article::findOrFail($id);
     $article['updated_at'] = Carbon::now('Asia/Shanghai');
     $article->update($request->all());
     return redirect('article');
 }
開發者ID:2zH,項目名稱:wind.moe,代碼行數:10,代碼來源:WindController.php

示例14: show

 public function show(Article $article)
 {
     if (!$article->is_visible and \Auth::guest()) {
         return abort(403);
     }
     if (\Auth::check() and !is_admin_role(\Auth::user())) {
         if (!$article->is_visible and !\Auth::user()->owns($article)) {
             return abort(403);
         }
     }
     return view('article.show', compact('article'));
 }
開發者ID:Ravend6,項目名稱:laravel_base_v5.2,代碼行數:12,代碼來源:ArticleController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $greet = '';
     $submission = null;
     if (\Auth::check()) {
         $user = \Auth::user();
         $greet = $this->setGreeting($user);
         $submission = Submission::where('facebook_id', $user->facebook_id)->first();
     } else {
         $user = \Auth::guest();
     }
     return view('index')->with('user', $user)->with('greeting', $greet)->with('submission', $submission);
 }
開發者ID:Shahar-Galukman,項目名稱:listen,代碼行數:18,代碼來源:SongsController.php


注:本文中的App\Http\Controllers\Auth::guest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。