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\Models\Reference;
use App\Policies\BasePolicy;
class ReferencePolicy extends BasePolicy
{
/**
* Determine whether the user can view the reference.
*
* @param \App\Models\User $user
* @param \App\Models\Reference $reference
* @return mixed
*/
public function view(User $user, Reference $reference)
return $user->hasRole('applicant') && $reference->applicant->user->is($user);
}
* Determine whether the user can create references.
public function create(User $user)
return $user->hasRole('applicant');
* Determine whether the user can update the reference.
public function update(User $user, Reference $reference)
* Determine whether the user can delete the reference.
public function delete(User $user, Reference $reference)