From d78e06a328b1f06ae0bbe77a2d96cb304e23878d Mon Sep 17 00:00:00 2001 From: Mateja Date: Tue, 20 Oct 2020 00:05:48 +0200 Subject: Database, controller and news views. --- app/Http/Controllers/PagesController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 086f2b9..c65e821 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use App\Models\Post; class PagesController extends Controller { @@ -20,7 +21,10 @@ class PagesController extends Controller public function news(Request $request) { - return view('pages.news'); + $news = Post::all(); + + //return view('pages.news')->with('news', $news); + return view('pages.news', compact('news')); } public function gallery(Request $request) -- cgit v1.2.3