本文整理汇总了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');
}
示例2: getRegister
public function getRegister()
{
if (\Auth::guest()) {
return redirect('auth/login');
}
return view('admin/register');
}
示例3: view_product
public function view_product()
{
if (\Auth::guest()) {
return redirect('auth/login');
}
return view('backoffice.cart_view_products');
}
示例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');
}
示例5: registerForm
public function registerForm()
{
if (!\Auth::guest()) {
return redirect('/');
}
return view('auth.register');
}
示例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')]);
}
示例7: register
public function register()
{
if (\Auth::guest()) {
return redirect('auth/login');
}
return \Auth::user()->name;
return view('Pages.register');
}
示例8: header
public static function header()
{
if (\Auth::guest()) {
$count = null;
} else {
$count = FollowController::getCounter(\Auth::user()->name);
}
return $count;
}
示例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');
}
}
示例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'));
}
示例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');
}
示例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 . '');
}
示例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');
}
示例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'));
}
示例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);
}