-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hasRole does not exist Error #625
Comments
Follow the documentation: https://laratrust.santigarcor.me/docs/8.x/installation.html
use Laratrust\Contracts\LaratrustUser;
use Laratrust\Traits\HasRolesAndPermissions;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements LaratrustUser
{
use HasRolesAndPermissions;
// ...
} |
I have done that and here is my user model and Dashboard file repository address. |
I just created a new Laravel installation, installed Laratrust per documentation and What happens if you execute the following code at the beginning of the DashboardController::index() method? dd(Auth::user()); |
This is the result. App\Models\User {#666 ▼ // app\Http\Controllers\DashboardController.php:14 |
What about: dump(class_uses(Auth::user()));
dd(method_exists(Auth::user(), 'hasRole')); |
I added |
Hello I still have problem with new Laratrust version, It give me (hasRole does not exist) error.
It create the user but when I write a condition like I used to do before to redirect each user to specific page it give me above mentioned error.
Please help me with this.
Thank you
The text was updated successfully, but these errors were encountered: