diff options
author | Mateja <mail@matejamaric.com> | 2020-10-20 00:05:48 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-10-20 00:05:48 +0200 |
commit | d78e06a328b1f06ae0bbe77a2d96cb304e23878d (patch) | |
tree | 17065caeda9221eb6ccc4795fcf0b08d673c18c7 /app/Http/Controllers/PagesController.php | |
parent | df3e709ea53fb9ea34224f3ad42d4f8dbbaf049d (diff) | |
download | yota-laravel-d78e06a328b1f06ae0bbe77a2d96cb304e23878d.tar.gz yota-laravel-d78e06a328b1f06ae0bbe77a2d96cb304e23878d.zip |
Database, controller and news views.
Diffstat (limited to 'app/Http/Controllers/PagesController.php')
-rw-r--r-- | app/Http/Controllers/PagesController.php | 6 |
1 files changed, 5 insertions, 1 deletions
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) |