warehouse_id == $carUser->warehouse->id && ($user->role == RoleEnum::DISPATCHER || $user->role == RoleEnum::ADMIN); } public function update(User $user, Car $car) { return $user->warehouse_id == $car->user->warehouse_id && ($user->role == RoleEnum::DISPATCHER || $user->role == RoleEnum::ADMIN); } public function delete(User $user, Car $car) { return $user->warehouse_id == $car->user->warehouse_id && $user->role == RoleEnum::ADMIN; } }