本文整理匯總了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'));
}