Laravel comment interroger la relation appartenance
$movies = Movie::whereHas('director', function($q) {
$q->where('name', 'great');
})->get();
Fragile Flatworm
$movies = Movie::whereHas('director', function($q) {
$q->where('name', 'great');
})->get();
use App\Models\User;
$user = User::find(1);
$user->roles()->attach($roleId);