/** * Show list of available groups for current user. * * @param int $userId * @return \Illuminate\View\View */ public function create($userId) { $user = $this->users->findById($userId); $groups = $this->groups->findAll(); $userGroups = $user->getGroups()->lists('id'); foreach ($groups as $i => $group) { if (in_array($group->id, $userGroups)) { unset($groups[$i]); } } return View::make('laravel-sentry-backend::usergroups.create', compact('user', 'groups')); }
public function testFindAll() { Sentry::shouldReceive('findAllGroups')->once()->andReturnNull(); $this->assertNull($this->groups->findAll()); }
/** * Display a listing of the groups. */ public function index() { $groups = $this->groups->findAll(); return View::make('laravel-sentry-backend::groups.index', compact('groups')); }