aboutsummaryrefslogtreecommitdiff
path: root/app/Http/Controllers/NewsController.php
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-02 15:25:36 +0100
committerMateja <mail@matejamaric.com>2020-11-02 15:25:36 +0100
commitb5afd40a49a2c2b061865a501103ea2a060f4997 (patch)
tree64b8ced33431c908442881ff3e63b898023f3c3e /app/Http/Controllers/NewsController.php
parentcd8cfe9d6a0b786e03142ae492b2d0d52f92e4f8 (diff)
downloadyota-laravel-b5afd40a49a2c2b061865a501103ea2a060f4997.tar.gz
yota-laravel-b5afd40a49a2c2b061865a501103ea2a060f4997.zip
Standardized controllers to CRUD...
Diffstat (limited to 'app/Http/Controllers/NewsController.php')
-rw-r--r--app/Http/Controllers/NewsController.php92
1 files changed, 92 insertions, 0 deletions
diff --git a/app/Http/Controllers/NewsController.php b/app/Http/Controllers/NewsController.php
new file mode 100644
index 0000000..d44ebd9
--- /dev/null
+++ b/app/Http/Controllers/NewsController.php
@@ -0,0 +1,92 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use function dd;
+
+use App\Models\Post;
+
+class NewsController extends Controller
+{
+ /**
+ * Display a listing of the resource.
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function index()
+ {
+ $news = Post::orderBy('created_at', 'desc')->get();
+
+ //$data = ['news' => $news];
+ //return view('pages.news')->with($data);
+ //return view('pages.news')->with('news', $news);
+ return view('pages.news', compact('news'));
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function create()
+ {
+ //
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return \Illuminate\Http\Response
+ */
+ public function store(Request $request)
+ {
+ //
+ }
+
+ /**
+ * Display the specified resource.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function show($id)
+ {
+ //
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function edit($id)
+ {
+ //
+ }
+
+ /**
+ * Update the specified resource in storage.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function update(Request $request, $id)
+ {
+ //
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function destroy($id)
+ {
+ //
+ }
+}