本文整理汇总了PHP中app\Customer::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::all方法的具体用法?PHP Customer::all怎么用?PHP Customer::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Customer
的用法示例。
在下文中一共展示了Customer::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store(ItemRequest $request)
{
try {
$customers = Customer::all();
Item::create($request->all());
$item = Item::orderBy('created_at', 'desc')->first();
foreach ($customers as $customer) {
Price::create(['item_id' => $item->id, 'customer_id' => $customer->id, 'custom_price' => $item->price, 'sellable' => '1', 'is_custom' => '0']);
}
return redirect('item')->with('message', 'Data berhasil dibuat!');
} catch (\Illuminate\Database\QueryException $e) {
return redirect('item')->with('message', 'Data dengan nama tersebut sudah digunakan!');
} catch (\PDOException $e) {
return redirect('item')->with('message', 'Data dengan nama tersebut sudah digunakan!');
}
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
$customer = Customer::all();
// dd($customer);
return View('customer.index')->with('customer', $customer);
}
示例3: xlsFileCustomer
public function xlsFileCustomer()
{
$namefile = date('Yh:i:s') . "_Customer";
Excel::create($namefile, function ($excel) {
// Set the title
$excel->setTitle('NMK Customer Form');
// Chain the setters
$excel->setCreator('NMK Application')->setCompany('NMK');
// Call them separately
$excel->setDescription('This files has all lead form record');
$excel->sheet('Excel sheet', function ($sheet) {
$roadshows = Customer::all();
$sheet->setStyle(array('font' => array('name' => 'Calibri', 'size' => 13)));
$sheet->row(1, array('Company', 'Contact Person', 'Telephone', 'Mobile', 'Address', 'P.O. Box', 'City', 'Delivery Address', 'Email'));
foreach ($roadshows as $key => $value) {
$sheet->row(1, function ($row) {
// call cell manipulation methods
$row->setBackground('#888888');
$row->setFont(array('family' => 'Calibri', 'size' => '16', 'bold' => true));
});
$sheet->rows(array(array($value->company, $value->person, $value->telephone, $value->mobile, $value->address, $value->pobox, $value->city, $value->deliveryAddress, $value->email)));
}
//$sheet->fromModel($roles);
// $sheet->fromArray(array(
// array('Name', 'Phone','Email','Job Title','Company','Intrested Brand','Intrested Seminiar'),
// $leads
// ));
$sheet->setOrientation('landscape');
});
})->export('xls');
}
示例4: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$customers = Customer::all();
// return view('order.create',compact('customers', $customers));
return view('order.create', array('customers' => $customers));
// return view('order.create');
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($idkas)
{
$kas = Kas::find($idkas);
$cust = Customer::all();
$data = array('kas' => $kas, 'cust' => $cust);
return View('kas.edit')->with('data', $data);
}
示例6: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($idpic)
{
$pic = Pic::find($idpic);
$cust = Customer::all();
$data = array('pic' => $pic, 'cust' => $cust);
return View('pic.edit')->with('data', $data);
}
示例7: create
public function create()
{
$input = Input::all();
$customers = Customer::all();
$salesmen = Employee::all();
return view('return.create', compact('input', 'customers', 'salesmen'));
}
示例8: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($idms)
{
$ms = Ms::find($idms);
$cust = Customer::all();
$data = array('ms' => $ms, 'cust' => $cust);
return View('ms.edit')->with('data', $data);
//
}
示例9: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$customers = Customer::all();
foreach ($customers as $customer) {
$customer->old_password = $customer->password;
$customer->save();
}
}
示例10: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($idtr)
{
$tr = Tr::find($idtr);
$cust = Customer::all();
$data = array('tr' => $tr, 'cust' => $cust);
return View('tr.edit')->with('data', $data);
//
}
示例11: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$estimates = Estimate::orderBy('id', 'DESC')->get();
$customers = Customer::all();
$vehicles = Vehicle::all();
$departments = Department::all();
$users = User::all();
return view('estimates.estimates', compact('estimates', 'customers', 'vehicles', 'departments', 'users'));
}
示例12: search
public function search()
{
$products = Product::all();
$doctors = Customer::all();
$MRs = Employee::where('level_id', 7)->get();
$AMs = Employee::where('level_id', 3)->get();
$SMs = Employee::where('level_id', 2)->get();
$dataView = ['products' => $products, 'doctors' => $doctors, 'MRs' => $MRs, 'AMs' => $AMs, 'SMs' => $SMs];
return view('admin.search.sales.search', $dataView);
}
示例13: index
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$provisioning = Provisioning::all();
$customers = Customer::all();
$onts = Ont::all();
$accessSwitches = AccessSwitch::all();
$dhcpSharedNetworks = DhcpSharedNetwork::all();
$ipaddresses = Ipaddress::all();
$ports = AccessSwitchPort::all();
return view('home')->with('provisioning', $provisioning)->with('customers', $customers)->with('onts', $onts)->with('accessSwitches', $accessSwitches)->with('ports', $ports)->with('ipaddresses', $ipaddresses)->with('DhcpSharedNetworks', $dhcpSharedNetworks);
}
示例14: create
public function create()
{
$customers = Customer::all();
$coffee1 = DB::table('coffees')->where('id', 2)->first();
$coffee2 = DB::table('coffees')->where('id', 3)->first();
$coffee3 = DB::table('coffees')->where('id', 4)->first();
$coffee4 = DB::table('coffees')->where('id', 5)->first();
$coffee5 = DB::table('coffees')->where('id', 6)->first();
$pastry1 = DB::table('pastries')->where('id', 7)->first();
$pastry2 = DB::table('pastries')->where('id', 10)->first();
$pastry3 = DB::table('pastries')->where('id', 11)->first();
$pastry4 = DB::table('pastries')->where('id', 12)->first();
$pastry5 = DB::table('pastries')->where('id', 15)->first();
return view('order.create', compact('customers', 'coffee1', 'coffee2', 'coffee3', 'coffee4', 'coffee5', 'pastry1', 'pastry2', 'pastry3', 'pastry4', 'pastry5'));
}
示例15: index
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index(request $request)
{
if ($request->input('st')) {
$site_id = $request->input('st');
$state_id = DB::table('site_details')->where('id', '=', $site_id)->pluck('state_id');
if ($state_id) {
$parameters = DB::table('parameters')->join('tests', 'tests.parameter_id', '=', 'parameters.id')->where('tests.state_id', '=', $state_id)->orderBy('parameters.name')->get();
}
} else {
$state_id = "";
$parameters = DB::table('parameters')->orderBy('parameters.name')->get();
}
$users = DB::table('users')->where('role_id', '=', 3)->select('id', 'name', 'email')->get();
$customers = Customer::all();
$orders = Order::where('customer_id', '=', 14)->get();
return view('order/index')->with(compact('parameters', 'users', 'orders', 'customers', 'state_id'));
}