public function update(EditServiceRequest $request, $id)
 {
     $id_user = Auth::user()->id;
     $services = Service::findOrFail($id);
     $services->iduser_update->{$id_user};
     $services->fill($request->all());
     $services->save();
     Session::flash('message', $services->name . ' Se actualizo exitosamente');
     return redirect()->back();
 }
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id, Phpgmaps $gmpas)
 {
     $service = Service::findOrFail($id);
     $config['center'] = $service->lat . ', ' . $service->lng;
     $config['zoom'] = 15;
     $gmpas->initialize($config);
     $marker = [];
     $marker['position'] = $service->lat . ', ' . $service->lng;
     $gmpas->add_marker($marker);
     $map = $gmpas->create_map();
     return view('services.show')->with('map', $map)->with('service', $service)->with('title', $service->name);
 }
Beispiel #3
0
 public function invoice($id)
 {
     $user = Auth::user();
     $reservation = Reservation::findOrFail($id);
     $service = Service::findOrFail($reservation->serviceid);
     $date = date('Y-m-d');
     $view = \View::make('user.reservations.thisreservation', compact('date', 'service', 'reservation', 'user'))->render();
     //return view('user.reservations.thisreservation', compact('data', 'date', 'invoice'));
     $pdf = \App::make('dompdf.wrapper');
     //dd($pdf);
     $pdf->loadHTML($view);
     return $pdf->download('Reservation');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function requestStatus(Request $request)
 {
     $services = Service::findOrFail($request->submit);
     $services->update(['status' => $request->status]);
     $user = User::where('id', '=', $services->user_id)->get()->first();
     if (isset($services->status)) {
         Mail::send('auth/emails.statusChange', ['services' => $services], function ($m) use($user) {
             $m->from('*****@*****.**', 'Team AfterCares');
             $m->to($user->email, $user->name)->subject('Change in status of request');
         });
         return back()->withInput();
     }
 }
Beispiel #5
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create(Request $request)
 {
     $visa = new Visa();
     $visa->name = $request->get("name");
     $visa->description = $request->get("description", "");
     $visa->save();
     $service = Service::findOrFail($request->get("service", 0));
     $product = new Product();
     $product->visa_id = $visa->id;
     $product->service_id = $service->id;
     $product->price = $request->get('price', 0);
     $product->save();
     $requirements = $request->get('requirements');
     if (is_array($requirements)) {
         foreach ($requirements as $req) {
             $visa->requirement()->attach($req);
         }
     }
     return redirect()->action("VisasController@adminIndex")->with('message', 'Visa added');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $service = Service::findOrFail($id);
     if ($request->sort_id > 0) {
         $service->sort_id = $request->sort_id;
     } else {
         $service->sort_id = $service->count() + 1;
     }
     $service->slug = !empty($request->slug) ? $request->slug : str_slug($request->title);
     $service->title = $request->title;
     $service->route = $request->route;
     $service->title_description = $request->title_description;
     $service->meta_description = $request->meta_description;
     $service->text = $request->text;
     if ($request->status == 'on') {
         $service->status = 1;
     } else {
         $service->status = 0;
     }
     $service->save();
     return redirect('/admin/services')->with('status', 'Сервис обновлен!');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $airport = Service::findOrFail($id);
     $airport->delete();
     return redirect('admin/services');
 }
 public function findService(Route $route)
 {
     $this->service = Service::findOrFail($route->getParameter('services'));
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(Request $route)
 {
     $serviceid = $route->input('serviceid');
     $service = Service::findOrFail($serviceid);
     return view('user.reservations.create')->with('service', $service);
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Service::findOrFail($id);
 }
Beispiel #11
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $service = Service::findOrFail($id);
     $service->delete();
     flash()->success('Service Deleted!');
     return redirect()->route('services.index');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $service = Service::findOrFail($id);
     Service::destroy($id);
     return redirect(route('services.' . $service->section))->with('message', 'Servicio ' . $service->name . ' eliminado corectamente');
 }