/**
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(ArticleRequest $request)
 {
     $input = $request->all();
     $input['published_at'] = Carbon::now();
     Article::create($input);
     return redirect('articles');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(ArticleRequest $request, $id)
 {
     if ($request->file('image')) {
         # code...
         $file = $request->file('image');
         $name = 'blogexodia_' . time() . '.' . $file->getClientOriginalExtension();
         $path = public_path() . '/images/articles/';
         $file->move($path, $name);
     }
     $article = Article::find($id);
     $article->fill($request->all());
     $article->save();
     $article->tags()->sync($request->tags);
     $image = new Image();
     $image->name = $name;
     $image->article()->associate($article);
     $image->save();
     Session::flash('message', 'Articulo Actualizado Correctamente');
     return Redirect::to('article');
 }