for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Repositories;
use Keyhunter\Administrator\Model\Role;
class RolesRepository extends Repository
{
/**
* Administrator.
*/
const ADMIN = 'admin';
* Simple user role.
const USER = 'member';
* @return Role
public function getModel()
return new Role();
}
* Get administrator role.
*
* @return mixed
public function getAdminRole()
return self::getModel()
->whereName(self::ADMIN)
->first();
* Get simple user's role.
public function getSimpleUserRole()
->whereName(self::USER)
* Get all active roles.
public function getPublic()
->whereActive(1)
->orderBy('rank', 'ASC')
->get();