So I use a package from github ticketit(https://github.com/xaviqv/ticketit) and this package has controllers included.
And I integrated it into fresh laravel application.
now, I want to add an API endpoints into my application, my question is
should I copy the controllers from the ticketit package in the vendor directory and create my app/http/controllers folder or should I access the controllers in the vendor ? or are there any good design out there I should do?
so what i'm planning to do is
Route::get('api/v1/getdata','TicketsController@data');
Route::get('/getdata','TicketsController@data');
Please help on the design,
If I try to edit the controllers inside the vendor folders and upload it in server for sure it will not be upload.
btw, I'm using Laravel 5.4 and Laravel passport.
ticketit allows using of custom routes file, you can use that to point to your own custom controllers.
You can replace the default routes file by changing the routes path setting from administration panel settings -> configuration -> initial -> routes
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
copy vendor/kordy/ticketit/src/routes.php to anywhere such as App\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 the app/Http/ticketit_routes.php file
