Courses

Flutter v2 Mobile App with Laravel API

General Sanctum Auth: Get/Use Tokens

Previous: Manage Transactions with Eloquent Mutators
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();
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.

avatar
You can use Markdown
avatar
You can use Markdown