/** * Show the form for creating a new resource. * * @return Response */ public function create($id) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $bedroom = Property::findOrFail($id); return view('admin.properties.bedrooms.index', compact('bedroom', 'user_role')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); //return dd($user); return view('admin.control.admin', compact('user_role')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $characteristic = new Amenity($request->all()); $characteristic->save(); return view('admin.control.admin', compact('user_role')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show() { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $properties = Property::select('id', 'name', 'image', 'status', 'num_bedrooms', 'description', 'country_id', 'service_id', 'state_id', 'city_id', 'property_type_id', 'user_id')->with('country')->with('service')->with('state')->with('city')->with('property_type')->with('user')->orderBy('name', 'ASC')->get(); //return dd($properties); return view('admin.properties.show', compact('properties', 'service', 'state', 'city', 'property_type', 'user', 'user_role')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request, Redirector $redirector) { $this->validate($request, ['category' => 'required', 'amenity' => 'required']); $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $characteristic = new Amenity($request->all()); $characteristic->save(); return $redirector->back(); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $text = TextWelcome::findOrFail($id); $text->fill(\Request::all()); $text->save(); Session::flash('message', 'El texto fue editado con exito'); return view('admin.panel.admin', compact('user_role')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, Request $request) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $property = Property::findOrFail($id); $property->delete(); $message = $property->name . ' Fue eliminado de nuestros registros'; if ($request->ajax()) { return response()->json(['id' => $property->id, 'message' => $message]); } Session::flash('message', $property->name . " Fue eliminado de nuestros registros"); return redirect()->route('admin.properties.show', compact('user_role')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, Redirector $redirector) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $bedroom = Bedroom::findOrFail($id); $bedroom->delete(); return view('admin.control.admin', compact('user_role')); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ public function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $user = User::findOrFail($id); $user->delete(); Session::flash('message', $user->full_name . ' fue eliminado correctamente'); return redirect()->route('admin.users.index'); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, Request $request) { $picture = Picture::findOrFail($id); $file1 = Input::file('image1'); $file2 = Input::file('image2'); $file3 = Input::file('image3'); $file4 = Input::file('image4'); $file5 = Input::file('image5'); $file6 = Input::file('image6'); $file7 = Input::file('image7'); $file8 = Input::file('image8'); $file9 = Input::file('image9'); if (Input::hasFile('image1')) { $fileName1 = $file1->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file1->move($path, $fileName1)) { $picture->image1 = $fileName1; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image2')) { $fileName2 = $file2->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file2->move($path, $fileName2)) { $picture->image2 = $fileName2; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image3')) { $fileName3 = $file3->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file3->move($path, $fileName3)) { $picture->image3 = $fileName3; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image4')) { $fileName4 = $file4->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file4->move($path, $fileName4)) { $picture->image4 = $fileName4; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image5')) { $fileName5 = $file5->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file5->move($path, $fileName5)) { $picture->image5 = $fileName5; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image6')) { $fileName6 = $file6->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file6->move($path, $fileName6)) { $picture->image6 = $fileName6; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image7')) { $fileName7 = $file7->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file7->move($path, $fileName7)) { $picture->image7 = $fileName7; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image8')) { $fileName8 = $file8->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file8->move($path, $fileName8)) { $picture->image8 = $fileName8; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } if (Input::hasFile('image9')) { $fileName9 = $file9->getClientOriginalName(); $path = base_path('../public_html/carousel'); if ($file9->move($path, $fileName9)) { $picture->image9 = $fileName9; $picture->save(); Session::flash('message', "Se ha mdificado el carrusel correctamente correctamente"); } } $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); return redirect()->route('admin.properties.show', compact('user_role')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $datos = Gastronomy::select('id', 'nombre', 'apellidos', 'acerca', 'docencia', 'property_id')->where('property_id', '=', $id)->get(); return view('admin.properties.chef.edit', compact('datos', 'id', 'user_id', 'user_role')); }
public function change() { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); return view('admin.users.changepass', compact('user_role')); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, $id) { $user_id = Auth::user()->id; $user_role = User::findOrfail($user_id); $properties = $request->property_id; $menu = $request->labelmenu; $drinks = $request->labeldrinks; $activities = $request->labelactivities; $id = $request->property_id; $files = File::select('id')->where('property_id', '=', $id)->get(); if ($menu == 'menu') { foreach ($files as $ides) { $file = Input::file('menu'); if (Input::hasFile('menu')) { $fileName = $file->getClientOriginalName(); $path = base_path('../public_html/menus'); if ($file->move($path, $fileName)) { $concha = File::findOrFail($ides->id); $concha->menu = $fileName; $concha->save(); Session::flash('procesorealizado', 'exito'); return view('admin.properties.ameneties.edit', compact('user_role', 'properties')); } } } } if ($drinks == 'drinks') { foreach ($files as $ides) { $file = Input::file('drinks'); if (Input::hasFile('drinks')) { $fileName = $file->getClientOriginalName(); $path = base_path('../public_html/drinks'); if ($file->move($path, $fileName)) { $concha = File::findOrFail($ides->id); $concha->drinks = $fileName; $concha->save(); Session::flash('procesorealizado', 'exito'); return view('admin.properties.ameneties.edit', compact('user_role', 'properties')); } } } } if ($activities == 'activities') { foreach ($files as $ides) { $file = Input::file('activities'); if (Input::hasFile('activities')) { $fileName = $file->getClientOriginalName(); $path = base_path('../public_html/activities'); if ($file->move($path, $fileName)) { $concha = File::findOrFail($ides->id); $concha->activities = $fileName; $concha->save(); Session::flash('procesorealizado', 'exito'); return view('admin.properties.ameneties.edit', compact('user_role', 'properties')); } } } } }