Example #1
0
 public function index()
 {
     if (\Request::ajax()) {
         $term = \Input::get('term');
         $filter = \Input::get('filter');
         switch ($filter) {
             case 'Administrator':
                 $group = 1;
                 break;
             case 'User':
                 $group = 2;
                 break;
             case 'Unconfirmed':
                 $group = 3;
                 break;
             default:
                 $group = null;
                 break;
         }
         $db = User::where('name', 'like', '%' . $term . '%');
         if ($group) {
             $db->where('group', $group);
         }
         $db->orderBy('name', 'asc');
         $dbr = $db->paginate();
         return \Response::json($dbr);
     } else {
         return view('user.index');
     }
 }
Example #2
0
<?php

return ['database' => 'default', 'grant_types' => ['authorization_code' => ['class' => '\\League\\OAuth2\\Server\\Grant\\AuthCodeGrant', 'access_token_ttl' => 3600, 'auth_token_ttl' => 60], 'password' => ['class' => '\\League\\OAuth2\\Server\\Grant\\PasswordGrant', 'callback' => function ($username, $password) {
    if (Auth::validate(['email' => $username, 'password' => $password])) {
        $user = \sms\User::where('email', $username)->first();
        return $user->id;
    } else {
        // dd($username);
        return false;
    }
}, 'access_token_ttl' => 3600], 'client_credentials' => ['class' => '\\League\\OAuth2\\Server\\Grant\\ClientCredentialsGrant', 'access_token_ttl' => 3600], 'refresh_token' => ['class' => '\\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant', 'access_token_ttl' => 3600, 'refresh_token_ttl' => 36000]], 'token_type' => 'League\\OAuth2\\Server\\TokenType\\Bearer', 'state_param' => false, 'scope_param' => false, 'scope_delimiter' => ',', 'default_scope' => null, 'access_token_ttl' => 3600, 'limit_clients_to_grants' => false, 'limit_clients_to_scopes' => false, 'limit_scopes_to_grants' => false, 'http_headers_only' => false];