/** * Add a hall service according to the details * provided in the Request. * * @param Request $request */ public function addHallService(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 no service exists, then create if ($hallService == null) { Hall_Services::create(['name' => $data['name'], 'rate' => $data['rate']]); } else { abort(403, $message); } }