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

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.

  1. 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
    }
}
  1. copy vendor/kordy/ticketit/src/routes.php to anywhere such as App\Http\ticketit_routes.php

  2. change the $main_route_path class to your new custom class:

...
Route::resource($main_route_path, 'App\Http\Controllers\SomeController', [
...
  1. Go to the ticketit administration panel/menu settings -> configuration -> Initial -> routes and set routes to the full path of the app/Http/ticketit_routes.php file

ticketit routes setting