How to check user login or not in Laravel?

Share Me
  •  
  •  
  •  
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

Hello dev’s
Hope all are okay. Todays tutorial only for beginner ,who is really new in laravel. I will show you how to check user is login or not in laravel application . If you are new in laravel and you trying to find how to detect user is login or not in your laravel application. So, it is really very easy to check because laravel  provide us  Auth facade for check user is login or not. So we can check bellow example of How to check user login or not in Laravel:

Example:

@if (Auth::check())
	{!! print_r("User is login.") !!}
@else
	{!! print_r("User is not login.") !!}
@endif

Read Also : How to Uninstall a Package in Laravel Command?

Thanks for read this, I hope it will you. You can also follow us on Facebook.

About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →