Closed Ningthem-Singh closed 4 months ago
Auth::user()
returns an interface that does not have those methods declared on it. You can use an ide helper like https://github.com/barryvdh/laravel-ide-helper or "cast" to the concrete type with an annotation.
/** @var \App\Models\User $user */
$user = Auth::user();
when i use the $user->save(); i get error saying Undefined method 'save'.intelephense(P1013) whereas the code syntax is correct as per laravel documentation. How do i remove the error being shown and also similarly when i use the hasRole() i get error