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


PHP Customer::orderBy方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $suppliers = Supplier::orderBy('name')->get();
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:12,代码来源:InventoryController.php

示例2: customers

 public function customers()
 {
     $search = \Input::get('q');
     if ($search) {
         $customers = \App\Customer::where('firstname', 'like', $search . '%')->orWhere('lastname', 'like', $search . '%')->orderBy('created_at', 'desc')->paginate($this->limit);
     } else {
         $customers = \App\Customer::orderBy('created_at', 'desc')->paginate($this->limit);
     }
     return view('admin.pages.customers', compact('customers'));
 }
开发者ID:candrasetiadi,项目名称:nvjvnjsdnnvdvdw,代码行数:10,代码来源:AdminController.php

示例3: create

 public function create()
 {
     $input = Input::all();
     $customer = null;
     if ($input != null) {
         $customer = Customer::firstOrNew(['name' => $input['order_by']]);
         $customer->address = $input['address'];
         $customer->save();
     }
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('order.create', compact(['employees', 'input', 'customer', 'customers']));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:13,代码来源:OrderController.php

示例4: rent

 public function rent(Request $request)
 {
     $data = $request->all();
     // If the movie isn't in any kiosk then provide the message and return to listing
     if (!($kiosks = $this->getKiosks($data))) {
         $this->setMessage('Sorry, this movie is currently not available in that format.  Try again later', 'error');
         return redirect('/');
     }
     // Get customer list
     $customers = Customer::orderBy('lastname')->orderBy('firstname')->get(['id', 'firstname', 'lastname'])->toArray();
     // dd($customers);
     return view('movies.rent')->with('movie_id', $data['movie_id'])->with('customers', $customers)->with('kiosks', $kiosks);
 }
开发者ID:smadeira,项目名称:yellowBucketLaravel,代码行数:13,代码来源:RentalController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(CustomerRequest $request)
 {
     try {
         Customer::create($request->all());
         $customer = Customer::orderBy('created_at', 'desc')->first();
         $items = Item::all();
         foreach ($items as $item) {
             Price::create(['item_id' => $item->id, 'customer_id' => $customer->id, 'custom_price' => $item->price, 'sellable' => '1']);
         }
         return redirect('customer')->with('message', 'Data berhasil dibuat!');
     } catch (\Illuminate\Database\QueryException $e) {
         return redirect('customer')->with('message', 'Data dengan email tersebut sudah digunakan!');
     } catch (\PDOException $e) {
         return redirect('customer')->with('message', 'Data dengan email tersebut sudah digunakan!');
     }
 }
开发者ID:Herlanggaws,项目名称:givani,代码行数:22,代码来源:CustomerController.php

示例6: function

| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use App\Customer;
use Illuminate\Http\Request;
/**
 * Display All Customers
 *
 * Route::get('/', function () {
 *    return view('customers');
 * });
 */
Route::get('/', function () {
    $customers = Customer::orderBy('created_at', 'desc')->get();
    return view('customers', ['customers' => $customers]);
});
/**
 * Add A New Customer
 */
Route::post('/customer', function (Request $request) {
    $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
    if ($validator->fails()) {
        return redirect('/')->withInput()->withErrors($validator);
    }
    $customer = new Customer();
    $customer->customer_name = $request->name;
    $customer->save();
    return redirect('/');
    // Create The Task...
开发者ID:mikemukul,项目名称:RBSystem,代码行数:31,代码来源:routes.php

示例7: destroy

 public function destroy($id)
 {
     Customer::find($id)->delete();
     $customers = Customer::orderBy('customer')->paginate(env('CUSTOMER_PAGINATION_MAX'));
     return view('customers.index')->with('customers', $customers);
 }
开发者ID:petrovitch,项目名称:chess,代码行数:6,代码来源:CustomersController.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Retrieve all the customers in the database and return them
     $customers = Customer::orderBy('first_name', 'asc')->get();
     return $customers;
 }
开发者ID:breenyoung,项目名称:wfadmin,代码行数:11,代码来源:CustomerController.php

示例9: index

 public function index()
 {
     $customers = Customer::orderBy('name')->get();
     return view('customer.home', compact('customers'));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:5,代码来源:CustomerController.php


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