This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 386
Custom routes and customizing Ticketit functions
Ahmed Kordy edited this page Oct 25, 2016
·
2 revisions
You can replace the default routes file by changing the routes
path setting from administration panel settings -> configuration -> initial -> routes
Useful if you want to replace any of the default components of Ticketit, as example:
If you want to change the behaviour of a single show, then you propably want to change the TicketsController@show
method.
- Make a new controller and make it extends
Kordy\Ticketit\Controllers\TicketsController
namespace App\Http\Controllers;
class SomeController extends Controller
{
public function show ($id)
{
//Do custom stuff
}
}
-
copy
vendor/kordy/ticketit/src/routes.php
to anywhere such asApp\Http\ticketit_routes.php
-
change the
$main_route_path
class to your new custom class:
...
Route::resource($main_route_path, 'App\Http\Controllers\SomeController', [
...
- Go to the ticketit administration panel/menu
settings -> configuration -> Initial -> routes
and set routes to the full path of theapp/Http/ticketit_routes.php
file