for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Policies;
use App\Models\User;
use App\Traits\AllowTrait;
use Illuminate\Auth\Access\HandlesAuthorization;
class CustomerContactPolicy
{
use AllowTrait;
App\Traits\AllowTrait
App\Policies\CustomerContactPolicy
$role_id
$username
$allow
use HandlesAuthorization;
/**
* Determine if the user can create a contact
*/
public function create(User $user)
return $this->checkPermission($user, 'Add Customer Contact');
}
* Determine if the user can update a contact
public function update(User $user)
return $this->checkPermission($user, 'Edit Customer Contact');
* Determine if the user can delete a contact
public function delete(User $user)
return $this->checkPermission($user, 'Delete Customer Contact');
* Determine if the user can restore a deleted contact
public function restore(User $user)
return $this->checkPermission($user, 'Manage Customers');
* Determine if the user can permanently delete a contact
public function forceDelete(User $user)