コード例 #1
0
 /**
  * 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'));
 }
コード例 #2
0
 public function testFindAll()
 {
     Sentry::shouldReceive('findAllGroups')->once()->andReturnNull();
     $this->assertNull($this->groups->findAll());
 }
コード例 #3
0
 /**
  * Display a listing of the groups.
  */
 public function index()
 {
     $groups = $this->groups->findAll();
     return View::make('laravel-sentry-backend::groups.index', compact('groups'));
 }