Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how login one user with id in laravel

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

Auth::logout();
Comment

login selected user laravel

// Manual Auth Login
$user = User::find(1);
Auth::login($user);

//OR
$user = User::where('otp',$request->otp)->first();
auth()->login($user);
Comment

PREVIOUS NEXT
Code Example
Php :: route laravel Target class [AuthController] does not exist 
Php :: php find if string contains words from list index 
Php :: laravel move file from local to s3 
Php :: php json data to array 
Php :: how to sort with array and after print by for loop in php 
Php :: wp add menu page and subpage 
Php :: get all class methods php 
Php :: php header x forwarder for 
Php :: how to get all the records with same ID in laravel 
Php :: curl error (code 3) url malformed laravel 
Php :: run codeigniter 4 with spark 
Php :: add another column in a table in laravel 
Php :: get data from another table laravel 
Php :: create curl api request php with para 
Php :: laravel all fillable 
Php :: how to upgrade php in mac mojave 
Php :: what is abstract class in php 
Php :: message get with return action laravel 
Php :: codeigniter how to know update failed 
Php :: php string functions 
Php :: switch php version ubuntu 20.04 
Php :: wp php get rows number from mysql 
Php :: how run job laravel in cpanel host 
Php :: laravel eloquent get fillable 
Php :: laravel api cors localhost issue 
Php :: Image not found or type unknown in pdf 
Php :: call api with php 
Php :: json_encode php 
Php :: php get last index of array 
Php :: php display json in browser 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =