/** * 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(); }
public function getLatestPublications() { return Publications::orderBy('published_at', 'desc')->where('published_at', '<=', Carbon::now())->get(); }