for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Policies;
use App\Tournament;
use App\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class TeamPolicy
{
use HandlesAuthorization;
/**
* Create a new policy instance.
* @param User $user
* @param $ability
* @return bool
*/
public function before(User $user, $ability)
$ability
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function before(User $user, /** @scrutinizer ignore-unused */ $ability)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if ($user->isSuperAdmin()) {
return true;
}
return null;
// You can create a user if you are not a simple user
public function create(User $user, Tournament $tournament)
return $user->isOwner($tournament);
public function edit(User $user, Tournament $tournament)
// You can store a user if you are not a simple user
public function store(User $user, Tournament $tournament)
public function update(User $user, Tournament $tournament)
public function delete(User $user, \Xoco70\LaravelTournaments\Models\Tournament $tournament)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.