public function uploadImages(Request $request) { $status = 0; $file = $request->file('file'); $hotelId = $request->input('hotelId'); $destinationPath = 'uploads/image/hotel/' . $hotelId . '/'; $filename = Library\Common::getTimeStamp() . '.' . $file->guessExtension(); $file->move($destinationPath, $filename); if (!file_exists($destinationPath . $filename)) { $status = 1; } return response()->json(array('status' => $status, 'imgFilePath' => $destinationPath . $filename, 'img' => asset($destinationPath . $filename))); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function create() { $facilities = []; $hoteFacility = Model\Hotel_Facility::all(); for ($i = 0; $i < sizeof($hoteFacility); $i++) { $hotelFacilitySub = Model\Hotel_Facility_Sub::where('facility_id', '=', $hoteFacility[$i]->id)->get(); // $pointsInfo =[ 'points' =>$points->points,'score'=>$points->score]; // $obj = ['id' => $hoteFacility[$i]->id, 'name' => $hoteFacility[$i]->name, 'sub' => $hotelFacilitySub]; $facilities[] = $obj; } $token = Library\Common::getQiniuToken(); return view('admin.hotelManagement.create', compact('token'), compact('facilities')); }