public function getUpdatePaymentAddressCustomer() { View::share(['navigator' => \NavigatorHelper::getNavigatorBarFE(), 'sideBar' => \NavigatorHelper::getSideBarFE()]); if (!Session::has('user')) { return redirect_errors('You login yet!'); } $user = Session::get('user'); if ($user['role_id'] != Role::CUS_ROLE_ID) { return redirect_errors('You are not Customer!'); } $customer = new Customer(); $cusInfo = $customer->with('user')->where('user_id', $user['id'])->first()->toArray(); $current_City = Address::find($cusInfo['city_id'])->id; $cities = Address::where('parent_id', 0)->get()->toArray(); $state = Address::find($cusInfo['state_id'])->toArray(); return view('change_payment_address.index')->with(['info' => $cusInfo, 'currentCity' => $current_City, 'cities' => $cities, 'state' => $state]); }
public function getCustomerDetail($id, Customer $customer) { $customerdetail = $customer->with('profile', 'payment')->whereId((int) $id)->first(); return view('customers.detail')->with(compact('customerdetail')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($idcus) { $customer = Customer::with('pic', 'kas', 'ms', 'tr')->find($idcus); return View('customer.show')->with('customer', $customer); // }
public function getStoreCustomers($id, $period) { if ($period == 'today') { $customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . Carbon::today() . '")')->paginate(10); } elseif ($period == 'week') { $lastWeek = Carbon::now()->subWeek(); $customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . $lastWeek . '")')->paginate(10); } elseif ($period == 'month') { $lastMonth = Carbon::now()->subMonth(); $customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . $lastMonth . '")')->paginate(10); } else { $customers = Customer::with('Store')->where('store_id', $id)->paginate(10); } $output = array('customers' => $customers, 'store_id' => $id); return view('admin.storeCustomers', $output); }
public function getCustomerForCashierDesk(Request $request, Customer $customer) { if ($request->ajax()) { $thc_customer = $customer->with('profile', 'payment')->where('thc', $request->input('thc'))->first(); return $thc_customer; } return ['error' => 'An error occurred!']; }
/** * Get the kiosks that have a movie with total qty by type (DVD or BluRay) * * @param $id * @return array */ public function getRentalHistory($id) { $rentals = Customer::with(['rentals' => function ($query) { return $query->with('movieTitle'); }])->find($id)->toArray(); return $rentals; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $customers = Customer::with('account')->get(); return view('customer.index', compact('customers')); }