Quantcast
Viewing latest article 3
Browse Latest Browse All 25

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

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 latest article 3
Browse Latest Browse All 25

Trending Articles



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