本文整理汇总了PHP中app\models\Customer::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::all方法的具体用法?PHP Customer::all怎么用?PHP Customer::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Customer
的用法示例。
在下文中一共展示了Customer::all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* O método precisa informar uma lista de produtos
* @return {view}
*/
public function create()
{
$stocks = Stock::all();
$customers = Customer::all();
$employees = Employee::all();
return view('pages.new_sale', ['stocks' => $stocks, 'customers' => $customers, 'employees' => $employees]);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//Cache::pull('customer');
$customers = Cache::get('customer', function () {
$customer = Customer::all();
Cache::forever('customer', $customer);
return $customer;
});
// print_r($customers);
// die;
return view('customer.main', ['theme' => 'default', 'customer' => $customers]);
}
示例3: save
public function save(Request $request)
{
$customer = Customer::create($request->all());
$customers = Customer::all();
return view('pages.customers', ['customers' => $customers]);
}
示例4: showAll
public function showAll()
{
$customers = Customer::all();
return view('customer_all', ['customers' => $customers->getArray()]);
}
示例5: listIDAndDesignGroupedByCustomer
/**
* Static function that returns the list of ids and designs grouped by customer
* @return mixed
*/
public static function listIDAndDesignGroupedByCustomer()
{
foreach (Customer::all() as $customer) {
if (isset($customer->jobCostings) && $customer->jobCostings->count() > 0) {
$list[$customer->customer_company_name] = $customer->jobCostings->pluck('jc_design_name', 'job_costing_id');
}
}
$list = collect($list);
return $list;
}
示例6: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return Customer::all();
}
示例7: create
/**
* Return a view with all the MOQ and relevant JobCosting
*
* @return $this
*/
public function create()
{
$this->authorize('edit_job_costings');
return view('jobcostings.create')->with(['jobcosting' => new JobCosting(), 'customers' => Customer::all()->sortBy('customer_company_name')]);
}
示例8: index
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
$customers = Customer::all();
return view('customers.index', compact('customers'));
}