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