本文整理汇总了PHP中app\Customer::whereCustomer_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::whereCustomer_id方法的具体用法?PHP Customer::whereCustomer_id怎么用?PHP Customer::whereCustomer_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Customer
的用法示例。
在下文中一共展示了Customer::whereCustomer_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Request $request)
{
if (Customer::whereCustomer_id($request->customer_id)->first()) {
$order = Order::create($request->all());
$order->user_id = Auth::user()->id;
$event = new Event();
$event->title = $request->title;
$event->start = $request->booked_at;
$event->order_id = $request->order_id;
$end = date_create($request->booked_at);
date_add($end, date_interval_create_from_date_string($request->estimated_time . ' hours'));
$event->end = date_format($end, 'Y-m-d H:i');
$order->save();
$event->save();
$order->event_id = $event->id;
$order->push();
return redirect('/order/' . $order->id . '/show');
}
return redirect('/order/create')->with("session", Alert::get("danger", "Något gick snett.. Försök igen!"));
}
示例2: saveAjax
public function saveAjax(Request $request)
{
$customer = Customer::whereCustomer_id($request->customer_id)->first();
$customer->fill($request->all());
$customer->push();
}
示例3: exists
public static function exists($customer_id)
{
return Customer::whereCustomer_id($customer_id)->first() ? true : false;
}