Quantcast
Channel: Login only if user is active using Laravel - Stack Overflow
Viewing all articles
Browse latest Browse all 25

Answer by John Magnolia for Login only if user is active using Laravel

$
0
0

With Laravel Fortify makes it much cleaner to Customizing User Authentication

E.g addded status to the user condition in the FortifyServiceProvider

use App\Models\User;use Illuminate\Http\Request;use Illuminate\Support\Facades\Hash;use Laravel\Fortify\Fortify;/** * Bootstrap any application services. * * @return void */public function boot(){    Fortify::authenticateUsing(function (Request $request) {        $user = User::where('email', $request->email)->where('status', 1)->first();        if ($user &&            Hash::check($request->password, $user->password)) {            return $user;        }    });    // ...}

Viewing all articles
Browse latest Browse all 25

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>