phpsa / filament-authentication

MIT License
113 stars 24 forks source link

Class "App\Models\User" not found #27

Closed moskoweb closed 2 years ago

moskoweb commented 2 years ago

Hello,

I do not use the User inside the folder, because it is an older project, and even defining the right path in the configuration file, it gives an error when accessing the users page.

How to correct? And how to set permission of who can access the pages?

phpsa commented 2 years ago

Update the config file to set the path to your user model, setup a policy file and register it for your user model: https://laravel.com/docs/9.x/authorization#registering-policies Filament uses the default policy mappings to determine who can access what. so index, show, update, store, delete should check your user

moskoweb commented 2 years ago

I set it in the configuration file for the new model, and even so the error occurs.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

JelleDijkhuizen commented 1 year ago

In laravel 10 with php 8.2 the issue is back. I think the problem is that the constuct function in userResource.php is no executed so the $model var is not updated to the one in de config.