cleaning up some stuff. changing routes. making it work actually...

This commit is contained in:
1day2die 2022-08-02 17:37:59 +02:00
parent c4d5246c9f
commit c823a03466
12 changed files with 40 additions and 40 deletions

View file

@ -122,7 +122,7 @@ class UserController extends Controller
"email" => "required|string|email",
"credits" => "required|numeric|min:0|max:99999999",
"server_limit" => "required|numeric|min:0|max:1000000",
"role" => Rule::in(['admin', 'mod', 'client', 'member']),
"role" => Rule::in(['admin', 'moderator', 'client', 'member']),
"referral_code" => "required|string|min:2|max:32|unique:users,referral_code,{$user->id}",
]);
@ -303,7 +303,7 @@ class UserController extends Controller
case 'admin':
$badgeColor = 'badge-danger';
break;
case 'mod':
case 'moderator':
$badgeColor = 'badge-info';
break;
case 'client':

View file

@ -1,6 +1,6 @@
<?php
namespace App\Http\Controllers\Mod;
namespace App\Http\Controllers\Moderation;
use App\Models\User;
use App\Models\Ticket;
@ -19,14 +19,14 @@ class TicketsController extends Controller
public function index() {
$tickets = Ticket::paginate(10);
$ticketcategories = TicketCategory::all();
return view("admin.ticket.index", compact("tickets", "ticketcategories"));
return view("moderator.ticket.index", compact("tickets", "ticketcategories"));
}
public function show($ticket_id) {
$ticket = Ticket::where("ticket_id", $ticket_id)->firstOrFail();
$ticketcomments = $ticket->ticketcomments;
$ticketcategory = $ticket->ticketcategory;
$server = Server::where('id', $ticket->server)->first();
return view("admin.ticket.show", compact("ticket", "ticketcategory", "ticketcomments", "server"));
return view("moderator.ticket.show", compact("ticket", "ticketcategory", "ticketcomments", "server"));
}
public function close($ticket_id) {

View file

@ -73,7 +73,7 @@ class Kernel extends HttpKernel
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'admin' => isAdmin::class,
'mod' => isMod::class,
'moderator' => isMod::class,
'api.token' => ApiAuthToken::class,
'checkSuspended' => CheckSuspended::class
];

View file

@ -18,7 +18,7 @@ class isMod
*/
public function handle(Request $request, Closure $next)
{
if (Auth::user() && Auth::user()->role == 'mod' || Auth::user() && Auth::user()->role == 'admin') {
if (Auth::user() && Auth::user()->role == 'moderator' || Auth::user() && Auth::user()->role == 'admin') {
return $next($request);
}

View file

@ -104,8 +104,8 @@
value="admin">
{{__(' Administrator')}}
</option>
<option @if($user->role == 'mod') selected @endif class="text-info" value="mod">
{{__(' Moderator')}}
<option @if($user->role == 'moderator') selected @endif class="text-info" value="moderator">
{{__('Moderator')}}
</option>
<option @if($user->role == 'client') selected @endif class="text-success"
value="client">

View file

@ -232,11 +232,11 @@
</a>
</li>
@if (Auth::user()->role == 'admin' || Auth::user()->role == 'mod')
@if (Auth::user()->role == 'admin' || Auth::user()->role == 'moderator')
<li class="nav-header">{{ __('Moderation') }}</li>
<li class="nav-item">
<a href="{{ route('mod.ticket.index') }}" class="nav-link @if (Request::routeIs('mod.ticket.*')) active @endif">
<a href="{{ route('moderator.ticket.index') }}" class="nav-link @if (Request::routeIs('mod.ticket.*')) active @endif">
<i class="nav-icon fas fa-ticket-alt"></i>
<p>{{ __('Ticket List') }}</p>
</a>

View file

@ -17,7 +17,7 @@ ___
You can respond to this ticket by simply replying to this email or through the admin area at the url below.
<br>
{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
<br>
{{__('Thanks')}},<br>

View file

@ -17,7 +17,7 @@ ___
You can respond to this ticket by simply replying to this email or through the admin area at the url below.
<br>
{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
<br>
{{__('Thanks')}},<br>

View file

@ -12,7 +12,7 @@
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{route('mod.ticket.index')}}">{{__('Ticket List')}}</a></li>
href="{{route('moderator.ticket.index')}}">{{__('Ticket List')}}</a></li>
</ol>
</div>
</div>
@ -52,7 +52,7 @@
{{ $ticket->ticketcategory->name }}
</td>
<td>
<a href="{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}">
<a href="{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}">
#{{ $ticket->ticket_id }} - {{ $ticket->title }}
</a>
</td>
@ -74,12 +74,12 @@
</td>
<td>{{ $ticket->updated_at }}</td>
<td>
<a data-content="View" data-toggle="popover" data-trigger="hover" data-placement="top" href="{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-eye"></i></a>
<form class="d-inline" action="{{ route('mod.ticket.close', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
<a data-content="View" data-toggle="popover" data-trigger="hover" data-placement="top" href="{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}" class="btn btn-sm text-white btn-info mr-1"><i class="fas fa-eye"></i></a>
<form class="d-inline" action="{{ route('moderator.ticket.close', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
@csrf
<button data-content="Close" data-toggle="popover" data-trigger="hover" data-placement="top" type="submit" class="btn btn-sm text-white btn-warning mr-1"><i class="fas fa-times"></i></button>
</form>
<form class="d-inline" action="{{ route('mod.ticket.delete', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
<form class="d-inline" action="{{ route('moderator.ticket.delete', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
@csrf
<button data-content="Delete" data-toggle="popover" data-trigger="hover" data-placement="top" type="submit" class="btn btn-sm text-white btn-danger mr-1"><i class="fas fa-trash"></i></button>
</form>

View file

@ -12,7 +12,7 @@
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{ route('mod.ticket.index') }}">{{ __('Ticket') }}</a>
href="{{ route('moderator.ticket.index') }}">{{ __('Ticket') }}</a>
</li>
</ol>
</div>
@ -74,7 +74,7 @@
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "mod")
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@ -99,7 +99,7 @@
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "mod")
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@ -114,7 +114,7 @@
</div>
@endforeach
<div class="comment-form">
<form action="{{ route('mod.ticket.reply')}}" method="POST" class="form">
<form action="{{ route('moderator.ticket.reply')}}" method="POST" class="form">
{!! csrf_field() !!}
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
<div class="form-group{{ $errors->has('ticketcomment') ? ' has-error' : '' }}">

View file

@ -74,7 +74,7 @@
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "mod")
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->role === "admin")
<span class="badge badge-danger"> Admin </span>
@ -99,7 +99,7 @@
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "mod")
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->role === "admin")
<span class="badge badge-danger"> Admin </span>

View file

@ -14,7 +14,7 @@ use App\Http\Controllers\Admin\SettingsController;
use App\Http\Controllers\Admin\UsefulLinkController;
use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\VoucherController;
use App\Http\Controllers\Mod\TicketsController as ModTicketsController;
use App\Http\Controllers\Moderation\TicketsController as ModTicketsController;
use App\Http\Controllers\Auth\SocialiteController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\NotificationController;
@ -173,7 +173,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
});
#mod
Route::prefix('mod')->name('mod.')->middleware('mod')->group(function () {
Route::prefix('moderator')->name('moderator.')->middleware('moderator')->group(function () {
#ticket moderation
Route::get('ticket', [ModTicketsController::class, 'index'])->name('ticket.index');
Route::get('ticket/show/{ticket_id}', [ModTicketsController::class, 'show'])->name('ticket.show');