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? (30 h 09 min)

You also get:

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

Already a member? Login here

Comments & Discussion

M
marko_mo ✓ Link copied!

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();
PK
Povilas Korop ✓ Link copied!

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.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.