/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // Return the view of the price panel $pricePanel = PriceModel::find($id); $admin = AdminProfile::all()->last(); return view("admin.price.edit.index", ['price' => $pricePanel, 'admin' => $admin]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function contactIndex() { $admin = AdminProfile::all()->last(); $extra = ExtraModel::all()->first(); //return return view('admin.extra.contact.index', ['admin' => $admin, 'extra' => $extra]); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { // Get all the data $admin = AdminProfile::all()->last(); $admin->name = $request->input('name'); $destinationPath = base_path('public/assets/img/adminprofile/'); $imagename = $admin->id . '.png'; $request->file('image')->move($destinationPath, $imagename); $admin->image = $imagename; $admin->save(); return Redirect::to('admin/'); }
/** * Display a listing of the resource. * return the data for graph * @return \Illuminate\Http\Response */ public function index() { $carbon = Carbon::now(); $admin = AdminProfile::all()->last(); /*Cars Model On Service Graph*/ $carsLuxary = CarsModel::all()->where('status', '2')->where('class', '1')->count(); $carsMiddle = CarsModel::all()->where('status', '2')->where('class', '2')->count(); $carsComfort = CarsModel::all()->where('status', '2')->where('class', '3')->count(); /*Price Plan Most Popular*/ $pricePlan1 = BookingsModel::all()->where('price_plan', '1')->count(); $pricePlan2 = BookingsModel::all()->where('price_plan', '2')->count(); $pricePlan3 = BookingsModel::all()->where('price_plan', '3')->count(); /*Bookings Status*/ $completed = BookingsModel::all()->where('status', '1')->where('receive_date', $carbon->subMonth())->count(); $onGoing = BookingsModel::all()->where('status', '2')->where('receive_date', $carbon->subMonth())->count(); $upComing = BookingsModel::all()->where('status', '3')->where('receive_date', $carbon->subMonth())->count(); return view('partials/index', ['admin' => $admin, 'carsLuxary' => $carsLuxary, 'carsMiddle' => $carsMiddle, 'carsComfort' => $carsComfort, 'pricePlan1' => $pricePlan1, 'pricePlan2' => $pricePlan2, 'pricePlan3' => $pricePlan3, 'carbon' => $carbon, 'completed' => $completed, 'onGoing' => $onGoing, 'upComing' => $upComing]); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $admin = AdminProfile::all()->first(); return view('admin.todo.add.index', ['admin' => $admin]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { //Edit data of the cars $cars = CarsModel::findOrFail($id); $admin = AdminProfile::all()->last(); return view('admin.cars.edit.index', ['cars' => $cars, 'admin' => $admin]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // //Loading model by ID $bookings = BookingsModel::find($id); $admin = AdminProfile::all()->last(); //Showing the specified data return view('admin.bookings.update.index')->with('bookings', $bookings, 'admin', $admin); }
/** * Test of the getting all data * * @return array * */ public function testAdminProfileData() { $adminData = AdminProfile::all()->first(); $this->visit('admin/profile')->assertEquals($adminData, $adminData); }