cleaning up some stuff. changing routes. making it work actually...
This commit is contained in:
parent
c4d5246c9f
commit
c823a03466
|
@ -122,7 +122,7 @@ class UserController extends Controller
|
||||||
"email" => "required|string|email",
|
"email" => "required|string|email",
|
||||||
"credits" => "required|numeric|min:0|max:99999999",
|
"credits" => "required|numeric|min:0|max:99999999",
|
||||||
"server_limit" => "required|numeric|min:0|max:1000000",
|
"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}",
|
"referral_code" => "required|string|min:2|max:32|unique:users,referral_code,{$user->id}",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ class UserController extends Controller
|
||||||
case 'admin':
|
case 'admin':
|
||||||
$badgeColor = 'badge-danger';
|
$badgeColor = 'badge-danger';
|
||||||
break;
|
break;
|
||||||
case 'mod':
|
case 'moderator':
|
||||||
$badgeColor = 'badge-info';
|
$badgeColor = 'badge-info';
|
||||||
break;
|
break;
|
||||||
case 'client':
|
case 'client':
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Mod;
|
namespace App\Http\Controllers\Moderation;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Ticket;
|
use App\Models\Ticket;
|
||||||
|
@ -19,14 +19,14 @@ class TicketsController extends Controller
|
||||||
public function index() {
|
public function index() {
|
||||||
$tickets = Ticket::paginate(10);
|
$tickets = Ticket::paginate(10);
|
||||||
$ticketcategories = TicketCategory::all();
|
$ticketcategories = TicketCategory::all();
|
||||||
return view("admin.ticket.index", compact("tickets", "ticketcategories"));
|
return view("moderator.ticket.index", compact("tickets", "ticketcategories"));
|
||||||
}
|
}
|
||||||
public function show($ticket_id) {
|
public function show($ticket_id) {
|
||||||
$ticket = Ticket::where("ticket_id", $ticket_id)->firstOrFail();
|
$ticket = Ticket::where("ticket_id", $ticket_id)->firstOrFail();
|
||||||
$ticketcomments = $ticket->ticketcomments;
|
$ticketcomments = $ticket->ticketcomments;
|
||||||
$ticketcategory = $ticket->ticketcategory;
|
$ticketcategory = $ticket->ticketcategory;
|
||||||
$server = Server::where('id', $ticket->server)->first();
|
$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) {
|
public function close($ticket_id) {
|
|
@ -73,7 +73,7 @@ class Kernel extends HttpKernel
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
'admin' => isAdmin::class,
|
'admin' => isAdmin::class,
|
||||||
'mod' => isMod::class,
|
'moderator' => isMod::class,
|
||||||
'api.token' => ApiAuthToken::class,
|
'api.token' => ApiAuthToken::class,
|
||||||
'checkSuspended' => CheckSuspended::class
|
'checkSuspended' => CheckSuspended::class
|
||||||
];
|
];
|
||||||
|
|
|
@ -18,7 +18,7 @@ class isMod
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next)
|
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);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
value="admin">
|
value="admin">
|
||||||
{{__(' Administrator')}}
|
{{__(' Administrator')}}
|
||||||
</option>
|
</option>
|
||||||
<option @if($user->role == 'mod') selected @endif class="text-info" value="mod">
|
<option @if($user->role == 'moderator') selected @endif class="text-info" value="moderator">
|
||||||
{{__('Moderator')}}
|
{{__('Moderator')}}
|
||||||
</option>
|
</option>
|
||||||
<option @if($user->role == 'client') selected @endif class="text-success"
|
<option @if($user->role == 'client') selected @endif class="text-success"
|
||||||
|
|
|
@ -232,11 +232,11 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</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-header">{{ __('Moderation') }}</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<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>
|
<i class="nav-icon fas fa-ticket-alt"></i>
|
||||||
<p>{{ __('Ticket List') }}</p>
|
<p>{{ __('Ticket List') }}</p>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -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.
|
You can respond to this ticket by simply replying to this email or through the admin area at the url below.
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
|
{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
{{__('Thanks')}},<br>
|
{{__('Thanks')}},<br>
|
||||||
|
|
|
@ -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.
|
You can respond to this ticket by simply replying to this email or through the admin area at the url below.
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
{{ route('mod.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
|
{{ route('moderator.ticket.show', ['ticket_id' => $ticket->ticket_id]) }}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
{{__('Thanks')}},<br>
|
{{__('Thanks')}},<br>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
|
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
|
||||||
<li class="breadcrumb-item"><a class="text-muted"
|
<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>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
{{ $ticket->ticketcategory->name }}
|
{{ $ticket->ticketcategory->name }}
|
||||||
</td>
|
</td>
|
||||||
<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 }}
|
#{{ $ticket->ticket_id }} - {{ $ticket->title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -74,12 +74,12 @@
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $ticket->updated_at }}</td>
|
<td>{{ $ticket->updated_at }}</td>
|
||||||
<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>
|
<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('mod.ticket.close', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
|
<form class="d-inline" action="{{ route('moderator.ticket.close', ['ticket_id' => $ticket->ticket_id ]) }}" method="POST">
|
||||||
@csrf
|
@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>
|
<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>
|
||||||
<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
|
@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>
|
<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>
|
</form>
|
|
@ -12,7 +12,7 @@
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
|
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
|
||||||
<li class="breadcrumb-item"><a class="text-muted"
|
<li class="breadcrumb-item"><a class="text-muted"
|
||||||
href="{{ route('mod.ticket.index') }}">{{ __('Ticket') }}</a>
|
href="{{ route('moderator.ticket.index') }}">{{ __('Ticket') }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<span class="badge badge-secondary"> Member </span>
|
<span class="badge badge-secondary"> Member </span>
|
||||||
@elseif ($ticket->user->role === "client")
|
@elseif ($ticket->user->role === "client")
|
||||||
<span class="badge badge-success"> Client </span>
|
<span class="badge badge-success"> Client </span>
|
||||||
@elseif ($ticket->user->role === "mod")
|
@elseif ($ticket->user->role === "moderator")
|
||||||
<span class="badge badge-info"> Moderator </span>
|
<span class="badge badge-info"> Moderator </span>
|
||||||
@elseif ($ticket->user->role === "admin")
|
@elseif ($ticket->user->role === "admin")
|
||||||
<span class="badge badge-danger"> Admin </span>
|
<span class="badge badge-danger"> Admin </span>
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<span class="badge badge-secondary"> Member </span>
|
<span class="badge badge-secondary"> Member </span>
|
||||||
@elseif ($ticketcomment->user->role === "client")
|
@elseif ($ticketcomment->user->role === "client")
|
||||||
<span class="badge badge-success"> Client </span>
|
<span class="badge badge-success"> Client </span>
|
||||||
@elseif ($ticketcomment->user->role === "mod")
|
@elseif ($ticketcomment->user->role === "moderator")
|
||||||
<span class="badge badge-info"> Moderator </span>
|
<span class="badge badge-info"> Moderator </span>
|
||||||
@elseif ($ticketcomment->user->role === "admin")
|
@elseif ($ticketcomment->user->role === "admin")
|
||||||
<span class="badge badge-danger"> Admin </span>
|
<span class="badge badge-danger"> Admin </span>
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<div class="comment-form">
|
<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() !!}
|
{!! csrf_field() !!}
|
||||||
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
|
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
|
||||||
<div class="form-group{{ $errors->has('ticketcomment') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('ticketcomment') ? ' has-error' : '' }}">
|
|
@ -74,7 +74,7 @@
|
||||||
<span class="badge badge-secondary"> Member </span>
|
<span class="badge badge-secondary"> Member </span>
|
||||||
@elseif ($ticket->user->role === "client")
|
@elseif ($ticket->user->role === "client")
|
||||||
<span class="badge badge-success"> Client </span>
|
<span class="badge badge-success"> Client </span>
|
||||||
@elseif ($ticket->user->role === "mod")
|
@elseif ($ticket->user->role === "moderator")
|
||||||
<span class="badge badge-info"> Moderator </span>
|
<span class="badge badge-info"> Moderator </span>
|
||||||
@elseif ($ticket->user->role === "admin")
|
@elseif ($ticket->user->role === "admin")
|
||||||
<span class="badge badge-danger"> Admin </span>
|
<span class="badge badge-danger"> Admin </span>
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<span class="badge badge-secondary"> Member </span>
|
<span class="badge badge-secondary"> Member </span>
|
||||||
@elseif ($ticketcomment->user->role === "client")
|
@elseif ($ticketcomment->user->role === "client")
|
||||||
<span class="badge badge-success"> Client </span>
|
<span class="badge badge-success"> Client </span>
|
||||||
@elseif ($ticketcomment->user->role === "mod")
|
@elseif ($ticketcomment->user->role === "moderator")
|
||||||
<span class="badge badge-info"> Moderator </span>
|
<span class="badge badge-info"> Moderator </span>
|
||||||
@elseif ($ticketcomment->user->role === "admin")
|
@elseif ($ticketcomment->user->role === "admin")
|
||||||
<span class="badge badge-danger"> Admin </span>
|
<span class="badge badge-danger"> Admin </span>
|
||||||
|
|
|
@ -14,7 +14,7 @@ use App\Http\Controllers\Admin\SettingsController;
|
||||||
use App\Http\Controllers\Admin\UsefulLinkController;
|
use App\Http\Controllers\Admin\UsefulLinkController;
|
||||||
use App\Http\Controllers\Admin\UserController;
|
use App\Http\Controllers\Admin\UserController;
|
||||||
use App\Http\Controllers\Admin\VoucherController;
|
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\Auth\SocialiteController;
|
||||||
use App\Http\Controllers\HomeController;
|
use App\Http\Controllers\HomeController;
|
||||||
use App\Http\Controllers\NotificationController;
|
use App\Http\Controllers\NotificationController;
|
||||||
|
@ -173,7 +173,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
#mod
|
#mod
|
||||||
Route::prefix('mod')->name('mod.')->middleware('mod')->group(function () {
|
Route::prefix('moderator')->name('moderator.')->middleware('moderator')->group(function () {
|
||||||
#ticket moderation
|
#ticket moderation
|
||||||
Route::get('ticket', [ModTicketsController::class, 'index'])->name('ticket.index');
|
Route::get('ticket', [ModTicketsController::class, 'index'])->name('ticket.index');
|
||||||
Route::get('ticket/show/{ticket_id}', [ModTicketsController::class, 'show'])->name('ticket.show');
|
Route::get('ticket/show/{ticket_id}', [ModTicketsController::class, 'show'])->name('ticket.show');
|
||||||
|
|
Loading…
Reference in a new issue