當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::all方法代碼示例

本文整理匯總了PHP中app\models\User::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::all方法的具體用法?PHP User::all怎麽用?PHP User::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\User的用法示例。


在下文中一共展示了User::all方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getUser

 public function getUser()
 {
     $all = User::all();
     $env = \App::environment();
     var_dump($all, $env);
     foreach ($all as $v) {
         var_dump($env);
         var_dump($v->name);
         var_dump($v->nickname);
         var_dump($v->createTime);
         var_dump($v->updateTime);
         var_dump($v->deleteTime);
     }
     //$id = 30;
     //$user = UserService::getUserById($id);
     //$list = UserService::getList(1,10);
     //\Debugbar::info();
     //\Debugbar::error('Error!');
     //\Debugbar::warning('Watch out…');
     //\Debugbar::addMessage('Another message', 'mylabel');
     //\Debugbar::startMeasure('render','Time for rendering');
     //\Debugbar::stopMeasure('render');
     //\Debugbar::addMeasure('now', LARAVEL_START, microtime(true));
     //echo 'ssss';
     //\Debugbar::disable();
     /*
     foreach($list  as $k=>$v){
     	   //var_dump($v['name']);
     }
     var_dump($list);
     */
 }
開發者ID:xzungshao,項目名稱:lar5-one,代碼行數:32,代碼來源:UserController.php

示例2: getFakerWithUniqueUserData

 /**
  * @return Faker
  */
 protected function getFakerWithUniqueUserData()
 {
     // Prepare an array with user data already used
     $users = User::all();
     if (!$this->uniques) {
         $uniques = ['username' => [], 'email' => []];
         foreach ($users as $user) {
             array_push($uniques['username'], [$user->username => null]);
             array_push($uniques['email'], [$user->email => null]);
         }
         $this->uniques = $uniques;
     }
     // As the array of already used faker data is protected in Faker and
     // has no accessor method, we'll rely on ReflectionObject to modify
     // the property before letting faker generate data.
     //though reflected object should be added to the faker itself somehow
     // which is hacky
     //so we decided to overcome it with bindTo hack
     $faker = Faker::create();
     $unique = $faker->unique();
     $binder = function ($value) {
         $this->unqiue = $value;
     };
     $unqiueBinder = $binder->bindTo($unique, $unique);
     $unqiueBinder($this->uniques);
     return $faker;
 }
開發者ID:TFidryForks,項目名稱:spira,代碼行數:30,代碼來源:HelpersTrait.php

示例3: delete

 public function delete($userType, $id, Request $req)
 {
     $temp = null;
     $profile = null;
     if ($userType == 'admin') {
         //$profile=  Founder::findOrFail($id)->toArray();
         //dd($profile);
         Admin::findOrFail($id)->delete();
     } elseif ($userType == 'founder') {
         //$profile=  Founder::findOrFail($id)->toArray();
         //dd($profile);
         Founder::findOrFail($id)->delete();
     } elseif ($userType = 'investor') {
         //$profile=  Investor::findOrFail($id)->toArray();
         //dd($profile);
         Investor::findOrFail($id)->delete();
     } elseif ($userType = 'campaign') {
         //$profile=  Investor::findOrFail($id)->toArray();
         //dd($profile);
         Campaign::findOrFail($id)->delete();
     }
     flash()->success($userType . ' Deleted');
     $users = User::all();
     return view('admin.home', compact('users'));
 }
開發者ID:jwgriff,項目名稱:group4-project,代碼行數:25,代碼來源:AdminController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $brand = Brand::all();
     $category = Category::all();
     $user = User::all();
     return view('product.create_new_product', compact('brand', 'category', 'subcat_level1', 'user'));
 }
開發者ID:khakanali,項目名稱:OpenMAll,代碼行數:12,代碼來源:ProductController.php

示例5: _init

 protected function _init()
 {
     parent::_init();
     $this->aclAdd('login', array('restricted', 'accounts'));
     $this->Facebook = new FacebookConnect(FACEBOOK_APP_ID, FACEBOOK_APP_SECRET, array('redirect_uri' => FACEBOOK_REDIRECT_URI));
     $this->tpl->assign('Facebook', $this->Facebook);
     $this->tpl->assign('users', User::all());
 }
開發者ID:rudiedirkx,項目名稱:openid_app,代碼行數:8,代碼來源:pagesController.php

示例6: all

 public function all()
 {
     $users = User::all();
     if ($users->isEmpty()) {
         return $this->responseNotFound(['Users is empty']);
     }
     return $this->responseOk($users);
 }
開發者ID:restoko,項目名稱:restoko-api,代碼行數:8,代碼來源:UsersController.php

示例7: getIndex

 public function getIndex()
 {
     $roles = [0 => 'Все'];
     foreach (Role::all() as $role) {
         $roles[$role->id] = $role->title;
     }
     return view('admin.users.index', ['users' => User::all(), 'roles' => $roles]);
 }
開發者ID:venomir,項目名稱:tc,代碼行數:8,代碼來源:UserController.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('profiles')->delete();
     $users = User::all();
     foreach ($users as $user) {
         Profile::create(['display_name' => 'The Real Doodle Maestro', 'user_id' => $user->id]);
     }
 }
開發者ID:shanth2600,項目名稱:project2,代碼行數:13,代碼來源:ProfilesTableSeeder.php

示例9: getIndex

 public function getIndex()
 {
     if (!$this->hasPermission('manage.user')) {
         return response()->view('errors.401', [], 401);
     }
     $users = User::all();
     return view('user.index', compact('users'));
 }
開發者ID:ardiansyah,項目名稱:laravel-starter,代碼行數:8,代碼來源:UserController.php

示例10: index

 /**
  * Get a set of application data.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $playlists = Playlist::byCurrentUser()->orderBy('name')->with('songs')->get()->toArray();
     // We don't need full song data, just ID's
     foreach ($playlists as &$playlist) {
         $playlist['songs'] = array_pluck($playlist['songs'], 'id');
     }
     return response()->json(['artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(), 'settings' => Setting::all()->lists('value', 'key'), 'playlists' => $playlists, 'interactions' => Interaction::byCurrentUser()->get(), 'users' => auth()->user()->is_admin ? User::all() : [], 'user' => auth()->user()]);
 }
開發者ID:Holdlen2DH,項目名稱:koel,代碼行數:14,代碼來源:DataController.php

示例11: create

 /**
  * Show the form for creating a new Role.
  *
  * @return Response
  */
 public function create()
 {
     $users = User::all();
     $userlist = array();
     foreach ($users as $key => $value) {
         $userlist[$value->objectId] = $value->username;
     }
     return view('roles.create')->with(array('users' => $userlist));
 }
開發者ID:SawMaineK,項目名稱:iwomenapp,代碼行數:14,代碼來源:RoleController.php

示例12: index

 /**
  * Get a set of application data.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $playlists = Playlist::byCurrentUser()->orderBy('name')->with('songs')->get()->toArray();
     // We don't need full song data, just ID's
     foreach ($playlists as &$playlist) {
         $playlist['songs'] = array_pluck($playlist['songs'], 'id');
     }
     return response()->json(['artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(), 'settings' => Setting::lists('value', 'key')->all(), 'playlists' => $playlists, 'interactions' => Interaction::byCurrentUser()->get(), 'users' => auth()->user()->is_admin ? User::all() : [], 'currentUser' => auth()->user(), 'useLastfm' => env('LASTFM_API_KEY') && env('LASTFM_API_SECRET'), 'currentVersion' => Application::VERSION, 'latestVersion' => auth()->user()->is_admin ? app()->getLatestVersion() : Application::VERSION]);
 }
開發者ID:bearzk,項目名稱:koel,代碼行數:14,代碼來源:DataController.php

示例13: index

 /**
  * Get a set of application data.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $playlists = Playlist::byCurrentUser()->orderBy('name')->with('songs')->get()->toArray();
     // We don't need full song data, just ID's
     foreach ($playlists as &$playlist) {
         $playlist['songs'] = array_pluck($playlist['songs'], 'id');
     }
     return response()->json(['artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(), 'settings' => auth()->user()->is_admin ? Setting::pluck('value', 'key')->all() : [], 'playlists' => $playlists, 'interactions' => Interaction::byCurrentUser()->get(), 'users' => auth()->user()->is_admin ? User::all() : [], 'currentUser' => auth()->user(), 'useLastfm' => Lastfm::used(), 'useYouTube' => YouTube::enabled(), 'allowDownload' => config('koel.download.allow'), 'cdnUrl' => app()->staticUrl(), 'currentVersion' => Application::VERSION, 'latestVersion' => auth()->user()->is_admin ? app()->getLatestVersion() : Application::VERSION]);
 }
開發者ID:phanan,項目名稱:koel,代碼行數:14,代碼來源:DataController.php

示例14: getIndex

 /**
  * get Index.
  *
  * @return Response Show Root dashboard
  */
 public function getIndex()
 {
     logger()->info(__METHOD__);
     logger()->warning('[ROOT ACCESS]');
     //////////////////
     // FOR REFACTOR //
     //////////////////
     $users = User::all();
     return view('Backend::dashboard', compact('users'));
 }
開發者ID:timegridio,項目名稱:backend,代碼行數:15,代碼來源:RootController.php

示例15: getIndex

 /**
  * get Index.
  *
  * @return Response Show Root dashboard
  */
 public function getIndex()
 {
     $this->log->info(__METHOD__);
     $this->log->warning('[ROOT ACCESS]');
     //////////////////
     // FOR REFACTOR //
     //////////////////
     $users = User::all();
     return view('root.dashboard', compact('users'));
 }
開發者ID:zeke8402,項目名稱:timegrid,代碼行數:15,代碼來源:RootController.php


注:本文中的app\models\User::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。