/** * Store a newly created resource in storage. * * @return Response */ public function store() { // var_dump(Input::All()); // die; // // 'categorias_id' => 'exists:rubros,id' $rules = ['articulo' => 'required', 'copete' => 'required', 'texto' => 'required']; if (!Articulo::isValid(Input::all(), $rules)) { return Redirect::back()->withInput()->withErrors(Articulo::$errors); } $articulo = new Articulo(); $articulo->users_id = Sentry::getUser()->id; $articulo->articulo = Input::get('articulo'); $articulo->copete = Input::get('copete'); $articulo->texto = Input::get('texto'); $articulo->tipo = Input::get('tipo'); $articulo->categorias_id = Input::get('categorias_id'); $url_seo = Input::get('articulo'); $articulo->estado = 'nuevo'; //$url_seo = $this->url_slug($url_seo) . implode("-",getdate()); $url_seo = $this->url_slug($url_seo) . date('ljSFY'); $articulo->url_seo = $url_seo; $articulo->save(); return Redirect::to('/articulos/ver'); }