ldc-crm/app/Policies/CustomerPolicy.php
2023-06-20 11:55:52 +02:00

27 lines
537 B
PHP

<?php
namespace App\Policies;
use App\Models\Customer;
use App\Models\Service;
use Illuminate\Auth\Access\HandlesAuthorization;
/**
* @codeCoverageIgnore
*/
class CustomerPolicy
{
use HandlesAuthorization;
/**
* Check if the customer belongs to the service
*
* @param Service $service
* @param Customer $customer
* @return boolean
*/
public function customerBelongsToService(Service $service, Customer $customer)
{
return !\is_null($customer->login($service->brand));
}
}