/**
  *This function is used to load the hall modal contents.This function response to
  *a ajax call.
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function hallViewLoad(Request $request)
 {
     $inputs = $request::all();
     $hall_id = $inputs['hall_id'];
     $himage1 = HALL_IMAGE::where('hall_id', '=', $hall_id)->select('path')->first();
     $himages = HALL_IMAGE::where('hall_id', '=', $hall_id)->where('path', '!=', $himage1->path)->select('path')->get();
     $advance = DB::table('HALL_RATES')->where('hall_id', '=', $hall_id)->select('advance_payment')->first();
     $refundable = DB::table('HALL_RATES')->where('hall_id', '=', $hall_id)->select('refundable_amount')->first();
     $services = Hall_Services::where('rate', '=', 0)->select('name', 'rate')->get();
     $aservices = Hall_Services::where('rate', '>', 0)->select('name', 'rate')->get();
     return response()->json(['himage1' => $himage1->path, 'himages' => $himages, 'advance' => $advance->advance_payment, 'refundable' => $refundable->refundable_amount, 'services' => $services, 'aservices' => $aservices]);
 }
 /**
  * Update Hall Service information
  *
  * @param Request $request
  */
 public function updateHallService(Request $request)
 {
     $message = "This Service already exists.";
     $data = $request->all();
     // Checks if any services with this name already exist
     $hallService = Hall_Services::where('name', trim($request->input('name')))->first();
     // if service exists, then update
     if ($hallService != null) {
         //$hallService = Hall_Services::find($request->input('hs_id'));
         //$hallService->name = $request->input('name');
         $hallService->rate = $request->input('rate');
         $hallService->save();
     } else {
         abort(403, $message);
     }
 }