From f7786be6652b0e851c0fcb9251e460fe9e9c65de Mon Sep 17 00:00:00 2001 From: Anders Date: Mon, 29 Jun 2020 12:56:08 +0200 Subject: [PATCH] Added Feedback index page + added routing in base.blade.php + Fixed routing in FeedbackController.php --- skolehjem/app/{Feedback.php => Feedbacks.php} | 2 +- .../Http/Controllers/FeedbackController.php | 14 +++++----- .../views/admin/feedbacks/index.blade.php | 27 +++++++++++++++++++ .../views/admin/layout/base.blade.php | 6 +++++ 4 files changed, 41 insertions(+), 8 deletions(-) rename skolehjem/app/{Feedback.php => Feedbacks.php} (71%) create mode 100644 skolehjem/resources/views/admin/feedbacks/index.blade.php diff --git a/skolehjem/app/Feedback.php b/skolehjem/app/Feedbacks.php similarity index 71% rename from skolehjem/app/Feedback.php rename to skolehjem/app/Feedbacks.php index dae03bd..cdd8531 100644 --- a/skolehjem/app/Feedback.php +++ b/skolehjem/app/Feedbacks.php @@ -4,7 +4,7 @@ namespace App; use Illuminate\Database\Eloquent\Model; -class Feedback extends Model +class Feedbacks extends Model { // } diff --git a/skolehjem/app/Http/Controllers/FeedbackController.php b/skolehjem/app/Http/Controllers/FeedbackController.php index 590e2f9..f920349 100644 --- a/skolehjem/app/Http/Controllers/FeedbackController.php +++ b/skolehjem/app/Http/Controllers/FeedbackController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Feedback; +use App\Feedbacks; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -17,9 +17,9 @@ class FeedbackController extends Controller */ public function index(Request $request) { - $feedback = Feedback::query()->paginate($request->input("limit", 20)); + $feedback = Feedbacks::query()->paginate($request->input("limit", 20)); - return Response::detect("feedback.index", [ "feedback" => $feedback ]); + return Response::detect("feedbacks.index", [ "feedback" => $feedback ]); } /** @@ -45,7 +45,7 @@ class FeedbackController extends Controller "link" => "required|max:255" ]); - $feedback = new Feedback($requestBody); + $feedback = new Feedbacks($requestBody); $feedback->save(); return Response::detect("feedback.store"); @@ -70,7 +70,7 @@ class FeedbackController extends Controller */ public function edit($id) { - $feedback = Feedback::find($id); + $feedback = Feedbacks::find($id); return Response::detect("feedbacks.edit", [ "feedback" => $feedback @@ -90,7 +90,7 @@ class FeedbackController extends Controller "time" => "required" ]); - $feedback = Feedback::find($id); + $feedback = Feedbacks::find($id); $feedback->update($data); @@ -109,7 +109,7 @@ class FeedbackController extends Controller */ public function destroy($id) { - $feedback = Feedback::find($id); + $feedback = Feedbacks::find($id); $feedback->delete(); return Response::detect("feedbacks.destroy"); diff --git a/skolehjem/resources/views/admin/feedbacks/index.blade.php b/skolehjem/resources/views/admin/feedbacks/index.blade.php new file mode 100644 index 0000000..3961ebb --- /dev/null +++ b/skolehjem/resources/views/admin/feedbacks/index.blade.php @@ -0,0 +1,27 @@ +@extends("admin.layout.base") +@extends("admin.layout.header") + +@section("title") + Feedback - Vis +@endsection + +@section("path") + Vis Feedback / +@endsection + +@section("content") + + + + + + @foreach($feedback as $fb) + + + + + @endforeach +
Feedback BeskedRis el. Ros
{{ $fb->message }}{{ $fb->suggestion_form }}
+ + {{ $feedback->links() }} +@endsection diff --git a/skolehjem/resources/views/admin/layout/base.blade.php b/skolehjem/resources/views/admin/layout/base.blade.php index e3398e2..bb2b8c3 100644 --- a/skolehjem/resources/views/admin/layout/base.blade.php +++ b/skolehjem/resources/views/admin/layout/base.blade.php @@ -67,6 +67,12 @@ CreateOpret Personal +
+

Feedback

+ +