From ffb31ac0ad4af8798174a110dd0443bb8b89267c Mon Sep 17 00:00:00 2001 From: SahrulGnwn Date: Fri, 12 Aug 2022 18:42:24 +0700 Subject: [PATCH 1/3] Some Change and Fix Fix upgrade button & Fix Blacklist Check & Change how users search on the blacklist --- .../Moderation/TicketsController.php | 4 +- app/Http/Controllers/TicketsController.php | 4 +- .../moderator/ticket/blacklist.blade.php | 74 +++++++++++++++++-- resources/views/servers/settings.blade.php | 13 +++- 4 files changed, 80 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Moderation/TicketsController.php b/app/Http/Controllers/Moderation/TicketsController.php index 7a9139d2..ac08ba08 100644 --- a/app/Http/Controllers/Moderation/TicketsController.php +++ b/app/Http/Controllers/Moderation/TicketsController.php @@ -117,9 +117,7 @@ class TicketsController extends Controller } public function blacklist() { - $users = User::paginate(); - $ticketcategories = TicketCategory::all(); - return view("moderator.ticket.blacklist", compact("users", "ticketcategories")); + return view("moderator.ticket.blacklist"); } public function blacklistAdd(Request $request) { diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php index f764da11..8bb21a66 100644 --- a/app/Http/Controllers/TicketsController.php +++ b/app/Http/Controllers/TicketsController.php @@ -31,7 +31,7 @@ class TicketsController extends Controller public function create() { #check in blacklist $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); - if($check->status == "True"){ + if($check && $check->status == "True"){ return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); } $ticketcategories = TicketCategory::all(); @@ -73,7 +73,7 @@ class TicketsController extends Controller public function reply(Request $request) { #check in blacklist $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); - if($check->status == "True"){ + if($check && $check->status == "True"){ return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); } $this->validate($request, array("ticketcomment" => "required")); diff --git a/resources/views/moderator/ticket/blacklist.blade.php b/resources/views/moderator/ticket/blacklist.blade.php index a1c2c2c1..e6a7ebb0 100644 --- a/resources/views/moderator/ticket/blacklist.blade.php +++ b/resources/views/moderator/ticket/blacklist.blade.php @@ -69,9 +69,6 @@
@@ -112,10 +109,73 @@ }); }); - @endsection diff --git a/resources/views/servers/settings.blade.php b/resources/views/servers/settings.blade.php index 9901e6c2..7607de10 100644 --- a/resources/views/servers/settings.blade.php +++ b/resources/views/servers/settings.blade.php @@ -251,7 +251,7 @@

-
+ @csrf