Laravel 56 Login and Logout

  • 17-03-2022
  • 1019
  • Laravel 6
  • Haresh Chauhan

Watch Youtube Video (HINDI) :

laravel provides a default auth system, how it can manage and how we can use this auth system without session global variable.

in this tutorial, I will guide what is the use of laravel default auth system.


before doing this task clone laravel fresh application Laravel
so let's do this task

open your terminal and fire the following command.

Step 1 : Clone Laravel Fresh Application.

composer create-project --prefer-dist laravel/laravel blog

after clone laravel application change directory in terminal using this command.

Step 2 : Move Your clone directory.

 cd blog 

after move in directory start laravel application.

Run Successfully laravel application in a web browser now we are setup to laravel default auth system (Login, Logout) So let's follow this command

Step 3 : Fire this command for generate auth

php artisan make:auth

now your auth files generated automatically from the laravel application.

Step 4 : Migrate your default migration file.

php artisan migrate

Step 5 : Start Application

php artisan serve

Complete Your default laravel auth system now we can use some auth function generated login data.

In this function we can check auth exists or not.

Auth::check();

You can get auth user information below this function.

Auth::user();
Auth::user()->id;
Auth::user()->name;
Auth::user()->email;

We always thanks to you for reading our blogs.


dharmesh-image

Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

haresh-image

Haresh Chauhan

(Co-Founder)


We Are Also Recommending You :