Laravel login with admin or user code example

Example 1: how login one user with id in laravel

public function manualLogin(){
    $user = User::find(1);
    Auth::login($user);
    return redirect('/');
}
///////////////////////////////////////////////////////////////
// or 

Auth::logout();

Example 2: how to separate admin and user login in laravel

public function up()
{
    Schema::create('admins', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->string('email')->unique();
        $table->string('password');
        $table->rememberToken();
        $table->timestamps();
    });
}

Tags:

Php Example