Esempio n. 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(News $NewsModel, Publications $PublicationsModel)
 {
     $news = $NewsModel->getLatestThreeNews();
     $publications = $PublicationsModel->getLatestThreePublications();
     return view('welcome', ['news' => $news, 'publications' => $publications]);
 }
 public function SoftDelete(Publications $publication)
 {
     $publication->delete();
 }
Esempio n. 3
0
 public function getLatestPublications()
 {
     return Publications::orderBy('published_at', 'desc')->where('published_at', '<=', Carbon::now())->get();
 }