/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request, $eventId) { $input = Input::except('token'); $roomId = Event::find($eventId)->room->id; $tableType = $table = new Table(); $validator = $table->getValidator($input); if ($validator->fails()) { return $this->respondInvalidData($validator->errors()); } $table->fill($input); $table->room_id = $roomId; $table->save(); return $this->respondCreateSuccess('Table: ' . $table->table_name . ' created'); }