We’ll go into the command line:
php artisan tinker
Now find a record:
$user = App\Models\User::find(2);
Find the user’s posts
$user->posts
Now check if it has roles:
$user->roles
We’ll go into the command line:
php artisan tinker
Now find a record:
$user = App\Models\User::find(2);
Find the user’s posts
$user->posts
Now check if it has roles:
$user->roles