Пример #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]);
 }
Пример #2
0
 public function SoftDelete(Publications $publication)
 {
     $publication->delete();
 }
Пример #3
0
 public function getLatestPublications()
 {
     return Publications::orderBy('published_at', 'desc')->where('published_at', '<=', Carbon::now())->get();
 }