Support the ongoing development of Laravel.io →
Authentication
Last updated 1 year ago.
0

are you including the User model at the top? if not try adding it in i.e.

use App\UserModel;

or try doing new \Article(...) //notice a back slash /

0

It sounds as though Auth::user() is returning null.

  1. Make sure you import the class. use Auth;

  2. Make sure you are authenticated.

0

Thank you guys for your prompt answers and help. Much appreciated.

Adding App\UserModel; did the trick.

Thanks again

Marea

0

Sign in to participate in this thread!

Eventy

Your banner here too?

lollylegs lollylegs Joined 23 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.