Fortify – A Weblog of Priyank Maniar https://priyank.rocks Articles on web development & mobile app development Tue, 05 Oct 2021 12:41:59 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 JetStream Fortify check if the user belongs to a specific role or is active while logging in https://priyank.rocks/fortify-check-if-the-user-belongs-to-a-specific-role-or-is-active/ Sun, 04 Apr 2021 12:24:27 +0000 https://priyank.rocks/?p=7588 This guide is helpful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// JetstreamServiceProvider.php

Fortify::authenticateUsing(function (Request $request) {
            $user = User::where('email', $request->email)->whereFileNumber($request->fileNumber)->userActive()->role('Debtor')->first();

            if ($user &&
                Hash::check($request->password, $user->password)) {

                $userLoginDetailObj = new UserLoginDetail();
                $userLoginDetailObj->loginDetails($user->id);

                return $user;
            }
        });
]]>
Fortify signup user with default as email verified | Inertia https://priyank.rocks/fortify-signup-user-with-default-as-email-verified-inertia/ Thu, 04 Mar 2021 15:00:48 +0000 https://priyank.rocks/?p=7568 The users table has email_verified_at. Fill this in when the user is created and this will mark the user as verified. It’s that simple.

]]>