예제 #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $title = Input::get('title');
     $text = Input::get('text');
     $tags = '<p><b>';
     $article = new App\News();
     $article->title = strip_tags($title, $tags);
     $article->text_news = strip_tags($text, $tags);
     $article->created_at = new \DateTime();
     $article->save();
     $last = App\News::orderby('id', 'desc')->first();
     $last['url'] = IndexController::translitURL($last['title']);
     $last['created'] = IndexController::restyleDate($last['created_at']);
     return ['article' => $last];
 }