Skip to main content

General Sanctum Auth: Get/Use Tokens

Premium
6:24

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

marko_mo avatar

Hi Pavilas, thanks for great content. I wonder why is it required to make a change (below)? - I am using Laravel 10 at the moment, if that makes any difference. Thanks in advance.

User::where('email', $request->email)->first()

To

\App\Models\User::where('email', $request->email)->first();
Povilas Korop avatar

It's just the difference if you load use App\Models\User; on top or not. If not, then you need to specify the full name like in your second example.