当前位置: 首页>>代码示例>>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;未经允许,请勿转载。