public function destroy($id) { $domain = Domain::find($id); if ($domain = null) { return response()->json(['error' => 'domain_does_not_existe'], 400); } $domain_id = $id; $zones = Zone::where('domain_id', '=', $domain_id)->delete(); $records = Record::where('domain_id', '=', $domain_id)->delete(); $domain = Domain::where('id', '=', $id)->delete(); return response()->json(['success'], 200); }
public function create($id) { $business = Business::all()->first(); $event = Event::find($id); $presentations = Presentation::where('event_id', $id)->where('cancelled', 0)->where('starts_at', '>', strtotime(Carbon::now()))->get(); foreach ($presentations as $presentation) { if ($presentation->cancelled == 0 || $presentation->cancelled != null) { $presentation->starts_at = date("d-m-Y h:i a", $presentation->starts_at); } } $presentations = $presentations->lists('starts_at', 'id'); $zones = Zone::where('event_id', $id)->lists('name', 'id'); $array = ['event' => $event, 'presentations' => $presentations, 'zones' => $zones, 'business' => $business]; return view('external.booking.create', $array); }
/** * Returns price of given zone * @param request $request Id of zone * @return Object Price */ public function getPrice(request $request) { $zone = Zone::where('id', $request['id'])->first(); return $zone; }
public function ajax($event_id) { $zones = Zone::where('event_id', $event_id)->lists('name', 'id'); return json_encode($zones); }