Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Change a routing from action(TicketsController@...) to route(Setting:…
Browse files Browse the repository at this point in the history
…:grab('main_route')...)

It need to use modified TicketsController.
  • Loading branch information
SevaCode committed Feb 3, 2020
1 parent b156152 commit 4b16a3e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,6 @@ public function demoDataSeeder()
$seeder->run();
session()->flash('status', 'Demo tickets, users, and agents are seeded!');

return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index');
return redirect()->route(Setting::grab('main_route') . '.index');
}
}
2 changes: 1 addition & 1 deletion src/Controllers/TicketsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function store(Request $request)

session()->flash('status', trans('ticketit::lang.the-ticket-has-been-created'));

return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index');
return redirect()->route(Setting::grab('main_route') . '.index');
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Middleware/IsAdminMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Kordy\Ticketit\Models\Agent;
use Kordy\Ticketit\Models\Setting;

class IsAdminMiddleware
{
Expand All @@ -21,7 +22,7 @@ public function handle($request, Closure $next)
return $next($request);
}

return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index')
return redirect()->route(Setting::grab('main_route') . '.index')
->with('warning', trans('ticketit::lang.you-are-not-permitted-to-access'));
}
}
3 changes: 2 additions & 1 deletion src/Middleware/IsAgentMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Kordy\Ticketit\Models\Agent;
use Kordy\Ticketit\Models\Setting;

class IsAgentMiddleware
{
Expand All @@ -21,7 +22,7 @@ public function handle($request, Closure $next)
return $next($request);
}

return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index')
return redirect()->route(Setting::grab('main_route'). '.index')
->with('warning', trans('ticketit::lang.you-are-not-permitted-to-access'));
}
}
2 changes: 1 addition & 1 deletion src/Middleware/ResAccessMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handle($request, Closure $next)
return $next($request);
}

return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index')
return redirect()->route(Setting::grab('main_route') . '.index')
->with('warning', trans('ticketit::lang.you-are-not-permitted-to-access'));
}
}
8 changes: 4 additions & 4 deletions src/Views/bootstrap3/shared/nav.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="panel panel-default">
<div class="panel-body">
<ul class="nav nav-pills">
<li role="presentation" class="{!! $tools->fullUrlIs(action('\Kordy\Ticketit\Controllers\TicketsController@index')) ? "active" : "" !!}">
<a href="{{ action('\Kordy\Ticketit\Controllers\TicketsController@index') }}">{{ trans('ticketit::lang.nav-active-tickets') }}
<li role="presentation" class="{!! $tools->fullUrlIs(route(Kordy\Ticketit\Models\Setting::grab('main_route') . '.index')) ? "active" : "" !!}">
<a href="{{ route(Kordy\Ticketit\Models\Setting::grab('main_route') . '.index') }}">{{ trans('ticketit::lang.nav-active-tickets') }}
<span class="badge">
<?php
if ($u->isAdmin()) {
Expand All @@ -16,8 +16,8 @@
</span>
</a>
</li>
<li role="presentation" class="{!! $tools->fullUrlIs(action('\Kordy\Ticketit\Controllers\TicketsController@indexComplete')) ? "active" : "" !!}">
<a href="{{ action('\Kordy\Ticketit\Controllers\TicketsController@indexComplete') }}">{{ trans('ticketit::lang.nav-completed-tickets') }}
<li role="presentation" class="{!! $tools->fullUrlIs(route(Kordy\Ticketit\Models\Setting::grab('main_route') . '-complete')) ? "active" : "" !!}">
<a href="{{ route(Kordy\Ticketit\Models\Setting::grab('main_route') . '-complete') }}">{{ trans('ticketit::lang.nav-completed-tickets') }}
<span class="badge">
<?php
if ($u->isAdmin()) {
Expand Down
8 changes: 4 additions & 4 deletions src/Views/bootstrap4/shared/nav.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<nav>
<ul class="nav nav-pills">
<li role="presentation" class="nav-item">
<a class="nav-link {!! $tools->fullUrlIs(action('\Kordy\Ticketit\Controllers\TicketsController@index')) ? "active" : "" !!}"
href="{{ action('\Kordy\Ticketit\Controllers\TicketsController@index') }}">{{ trans('ticketit::lang.nav-active-tickets') }}
<a class="nav-link {!! $tools->fullUrlIs(route(Kordy\Ticketit\Models\Setting::grab('main_route') . '.index')) ? "active" : "" !!}"
href="{{ route(Kordy\Ticketit\Models\Setting::grab('main_route') . '.index') }}">{{ trans('ticketit::lang.nav-active-tickets') }}
<span class="badge badge-pill badge-secondary ">
<?php
if ($u->isAdmin()) {
Expand All @@ -17,8 +17,8 @@
</a>
</li>
<li role="presentation" class="nav-item">
<a class="nav-link {!! $tools->fullUrlIs(action('\Kordy\Ticketit\Controllers\TicketsController@indexComplete')) ? "active" : "" !!}"
href="{{ action('\Kordy\Ticketit\Controllers\TicketsController@indexComplete') }}">{{ trans('ticketit::lang.nav-completed-tickets') }}
<a class="nav-link {!! $tools->fullUrlIs(route(Kordy\Ticketit\Models\Setting::grab('main_route') . '-complete')) ? "active" : "" !!}"
href="{{ route(Kordy\Ticketit\Models\Setting::grab('main_route') . '-complete') }}">{{ trans('ticketit::lang.nav-completed-tickets') }}
<span class="badge badge-pill badge-secondary">
<?php
if ($u->isAdmin()) {
Expand Down

0 comments on commit 4b16a3e

Please sign in to comment.