Hello everyone i am beginner on laravel so lets imagine i have roles and users table when deleted for example admin role on roles table need delete all users who have admin role i use many to many relationship
public function roles(){
return $this->belongsToMany(Role::class)->withTimestamps();
}
public function users(){
return $this->belongsToMany(User::class)->withTimestamps();
}