当前位置: 首页>>代码示例>>PHP>>正文


PHP User::get方法代码示例

本文整理汇总了PHP中app\User::get方法的典型用法代码示例。如果您正苦于以下问题:PHP User::get方法的具体用法?PHP User::get怎么用?PHP User::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\User的用法示例。


在下文中一共展示了User::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Usuarios

 public function Usuarios($action = null)
 {
     if (isset($action)) {
         if ($action == "create") {
             $data = User::firstOrCreate(Input::except("_token", "_user"));
             return $respuesta = array('Record' => $data, 'Result' => "OK");
         }
         if ($action == "edit") {
             User::where("id", Input::get("id"))->update(Input::except("_token", "id", "_user"));
             return $respuesta = array('Record' => User::find(Input::get('id')), 'Result' => "OK");
         }
         if ($action == "remove") {
             User::where('id', Input::get("id"))->delete();
             return '{"Result":"OK"}';
         }
         if ($action == "list") {
             $Records = User::get();
             $respuesta = array('Records' => $Records, 'Result' => "OK");
             return json_encode($respuesta);
         }
         if ($action == "empresas") {
             $nulos = DB::table('empresas')->select(DB::raw("'NO POSEE' as DisplayText, NULL as Value"));
             $respuesta = DB::table('empresas')->select("nombre as DisplayText", "id as Value")->union($nulos)->orderby('value', 'asc')->distinct()->get();
             return "var opciones=" . json_encode($respuesta);
         }
     }
 }
开发者ID:seedgabo,项目名称:DirectvMAC,代码行数:27,代码来源:AjaxController.php

示例2: testGet

 public function testGet()
 {
     $users = User::get();
     $this->assertEquals(3, $users->count());
     $users = User::where('id', '>', 1)->get();
     $this->assertEquals(2, $users->count());
     // test chunk
     User::chunk(2, function ($users) {
         foreach ($users as $user) {
             $this->assertInternalType('int', $user->id);
         }
     });
     User::chunk(1, function ($users) {
         $this->assertInstanceOf('Illuminate\\Support\\Collection', $users);
     });
     // test find with query builder
     $user = User::where('id', '>', 1)->find(1);
     $this->assertNull($user);
     $user = User::where('id', '>', 1)->find(2);
     $this->assertEquals(2, $user->id);
     // test first without query builder
     $user = User::first();
     $this->assertInstanceOf('App\\User', $user);
     // test retrieving aggregates
     $max_id = User::max('id');
     $this->assertGreaterThanOrEqual(3, $max_id);
     $count = User::count();
     $this->assertGreaterThanOrEqual(3, $count);
     $sum = User::sum('id');
     $this->assertGreaterThanOrEqual(6, $sum);
 }
开发者ID:richarddlu,项目名称:test_eloquent,代码行数:31,代码来源:EloquentTest.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (Team::get() as $te) {
         RelationTeUs::create(['team_id' => $te->id, 'user_coach_id' => $faker->numberBetween(1, count(User::get())), 'user_coach_aux_id' => $faker->numberBetween(1, count(User::get())), 'user_coordinador_id' => $faker->numberBetween(1, count(User::get())), 'user_cap_id' => $faker->numberBetween(1, count(User::get())), 'user_int2_id' => $faker->numberBetween(1, count(User::get())), 'user_int3_id' => $faker->numberBetween(1, count(User::get())), 'user_int4_id' => $faker->numberBetween(1, count(User::get()))]);
     }
 }
开发者ID:etciberoamerica,项目名称:robotica,代码行数:12,代码来源:RelationTeamUseSeeder.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $titulo = 'Usuarios';
     $users = User::get();
     //dd($users);
     return view('painel.tables', compact('users', 'titulo'));
 }
开发者ID:ronal2do,项目名称:stq001,代码行数:12,代码来源:UsuariosController.php

示例5: user

 function user()
 {
     $data = User::get();
     //       print_r($data);
     //       die;
     return view('user.home')->with('users', $data);
 }
开发者ID:BhimMahato,项目名称:larapro,代码行数:7,代码来源:mycontroller.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $users = User::get();
     $heading = 'User Management';
     return view('admin.users', array('users' => $users, 'heading' => $heading));
 }
开发者ID:matthiku,项目名称:LaravelWithSocialite,代码行数:12,代码来源:UserController.php

示例7: userPosts

 public function userPosts()
 {
     $posts = \App\Posts::where('user_id', '=', \Auth::user()->id)->orderBy("created_at", "desc")->get();
     $search_info = "";
     $data = array('posts' => $posts, 'search_info' => \Auth::user()->name . '\'s posts', 'users' => \App\User::get());
     return view('home')->with($data);
 }
开发者ID:steakyfask,项目名称:ShareStuff,代码行数:7,代码来源:HomeController.php

示例8: users

 /**
  * Display users management view.
  *
  * @return \Illuminate\Http\Response
  */
 public function users()
 {
     $users = User::all()->count();
     $requests = collect(Invitation::where('status', 1)->orWhere('status', 2)->orWhere('status', 4)->get());
     $lastest_users = User::get()->take(7);
     return view('sys/pages/users/view-all')->with(['users' => $users, 'requests' => $requests->count(), 'latest_users' => $lastest_users]);
 }
开发者ID:richardblondet,项目名称:tribu,代码行数:12,代码来源:UsersController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Request::isMethod('get')) {
         $this->data['items'] = User::get();
         return view('pages.user.index', $this->data);
     } elseif (Request::isMethod('post')) {
     }
 }
开发者ID:bilfash,项目名称:monstaff,代码行数:13,代码来源:UserController.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $rodeos = Rodeos::paginate(10);
     //print_r($animales); die();
     $potreros = Potreros::get()->all();
     $users = User::get()->all();
     return view('rodeos.index', ['rodeos' => $rodeos, 'potreros' => $potreros, 'users' => $users]);
 }
开发者ID:iarmoa,项目名称:gaia,代码行数:13,代码来源:RodeosController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     $this->data['users'] = User::get();
     $this->data['artikel'] = Artikel::where('kategori_id', '=', $id)->get();
     $this->data['kategori'] = Kategori::find($id);
     $this->data['id_kategori'] = $id;
     return view('admin.article.manage', $this->data);
 }
开发者ID:ryujikun,项目名称:bridge,代码行数:13,代码来源:ArtikelController.php

示例12: run

 public function run()
 {
     $faker = Faker::create();
     $users = User::get();
     #Category
     foreach (range(1, 20) as $void) {
         Log::create(['user_id' => $users->random(1)->id, 'type' => $faker->text(10), 'source_id' => $faker->numberBetween(50, 1000000), 'details' => $faker->text(50)]);
     }
 }
开发者ID:ant-vel,项目名称:Web,代码行数:9,代码来源:LogsTableSeeder.php

示例13: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     $users = User::get();
     // Get all the current users and associate them with manchester (MCR).
     foreach ($users as $user) {
         $user->city_id = null;
         $user->save();
     }
 }
开发者ID:EMT,项目名称:see-do,代码行数:14,代码来源:2016_05_18_144546_associate_current_users_with_mcr.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $users = User::get()->lists('id')->all();
     $products = Product::get()->lists('id')->all();
     foreach (range(1, 30) as $index) {
         Bid::create(['amount' => $faker->randomNumber(), 'user_id' => $faker->randomElement($users), 'product_id' => $faker->randomElement($products)]);
     }
 }
开发者ID:Tali2016,项目名称:repo,代码行数:14,代码来源:BidsTableSeeder.php

示例15: checkout

 public function checkout()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     $shoppingCarts = customer_item::where('customer_id', '=', \Auth::user()->id)->get();
     // get all selected shopping cart product from customer_items table
     $users = User::get();
     return view('Pages.checkout', compact('users', 'shoppingCarts'));
 }
开发者ID:AsyncIT,项目名称:iCart,代码行数:10,代码来源:ProductController.php


注:本文中的app\User::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。