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