Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $request->merge(['icons' => implode(',', $request->icons)]);
     $this->validate($request, ['title' => 'required|max:255', 'content' => 'required', 'time_start' => 'required|date', 'time_end' => 'required|date', 'venue' => 'required', 'color_scheme_id' => 'required|numeric|min:1', 'category_id' => 'required|numeric|min:1', 'icons' => 'required']);
     $event = new Event(Input::except(['tweet, city_id']));
     $event->setOwnerCurrentUser();
     $city_code = Input::get('city_code');
     $event->city_id = City::getIdfromIATA($city_code);
     $event->save();
     event(new SocialBroadcastEvent($event, $request));
     return redirect('/' . $city_code)->with('message', 'Event created');
 }