for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Traits;
trait RoleTrait
{
/**
* @return bool
*/
public function isSuperAdmin()
return $this->role_id == config('constants.ROLE_SUPERADMIN');
}
public function isFederationPresident()
return $this->role_id == config('constants.ROLE_FEDERATION_PRESIDENT');
public function isAssociationPresident()
return $this->role_id == config('constants.ROLE_ASSOCIATION_PRESIDENT');
public function isClubPresident()
return $this->role_id == config('constants.ROLE_CLUB_PRESIDENT');
public function isUser()
return $this->role_id == config('constants.ROLE_USER');
public function isUserOrMore()
return $this->role_id <= config('constants.ROLE_USER');
* @param $tournament
public function isOwner($tournament)
return $tournament->user_id == $this->id;