Added "orderBy" function to event and feedback.

This commit is contained in:
Anders 2020-08-03 08:46:38 +02:00
parent 1f5660001e
commit 1d63879117
3 changed files with 3 additions and 9 deletions

View File

@ -31,7 +31,7 @@ class EventController extends Controller
public function index(Request $request) public function index(Request $request)
{ {
$events = Event::query()->paginate($request->input("limit", 20)); $events = Event::query()->orderBY('date' , 'asc')->paginate($request->input("limit", 20));
//returns the function with events index page and a parameter of events. //returns the function with events index page and a parameter of events.
//also Response::detect checks screen size to determine if user is on a computer or mobile. //also Response::detect checks screen size to determine if user is on a computer or mobile.

View File

@ -28,7 +28,7 @@ class FeedbackController extends Controller
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$feedback = Feedbacks::query()->paginate($request->input("limit", 20)); $feedback = Feedbacks::query()->orderBy('created_at', 'desc')->paginate($request->input("limit", 20));
return Response::detect("feedbacks.index", [ "feedback" => $feedback ]); return Response::detect("feedbacks.index", [ "feedback" => $feedback ]);
} }
@ -59,7 +59,7 @@ class FeedbackController extends Controller
$feedbacks = new Feedbacks($requestBody); $feedbacks = new Feedbacks($requestBody);
$feedbacks->save(); $feedbacks->save();
return Response::detect("root.index"); return redirect()->route("root.index");
} }
/** /**

View File

@ -6943,9 +6943,3 @@ main {
display: inline-block; display: inline-block;
} }
.fa-eye {
position: absolute;
font-size: 25px;
color: grey;
margin: 7.5px 0 0 -45px;
}