public function GetSingleNews($id)
 {
     $n = News::GetSingleNews($id);
     $news = $n[0];
     $data["news"] = $news;
     $latestNews = News::GetLatestNews(3);
     $data["latestNews"] = $latestNews;
     return view("single_news", ["data" => $data]);
 }
 public function EditSelectedNews($id)
 {
     $title = $_POST["newsTitle"];
     $text = $_POST["newsText"];
     $author = $_POST["newsAuthor"];
     if (Input::hasFile("news_picture")) {
         $file = Input::file("news_picture");
         $folder = '/images/';
         $destinationPath = public_path() . $folder;
         $filename = str_random(6) . '_' . $file->getClientOriginalName();
         $img_path = $folder . $filename;
         $uploadSuccess = $file->move($destinationPath, $filename);
         $pd = News::GetSingleNews($id);
         $img = $pd[0]->news_image;
         if (File::exists(public_path() . $img)) {
             File::delete(public_path() . $img);
         }
     } else {
         $n = News::GetSingleNews($id);
         $img_path = $n[0]->news_image;
     }
     News::UpdateNews($title, $text, $img_path, $author, $id);
     return Redirect::back();
 }