for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Faithgen\AppBuild\Policies;
use App\Models\Ministry;
use Faithgen\AppBuild\Models\Build;
use Illuminate\Auth\Access\HandlesAuthorization;
class BuildPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view the build.
*
* @param Ministry $user
* @param Build $build
* @return mixed
*/
public function view(Ministry $user, Build $build)
return $user->id === $build->ministry_id;
}
* Determine whether the user can create builds.
public function create(Ministry $user)
$user
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
//
* Determine whether the user can update the build.
public function update(Ministry $user, Build $build)
$build
* Determine whether the user can delete the build.
public function delete(Ministry $user, Build $build)
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.