Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
Controllers in vendor folders - my controllers - what is the right approach?

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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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.

  1. Make a new controller and make it extends Kordy\Ticketit\Controllers\TicketsController

  2. copy vendor/kordy/ticketit/src/routes.php to anywhere such as App\Http\ticketit_routes.php

  3. change the $main_route_path class to your new custom class: Route::resource($main_route_path, 'App\Http\Controllers\SomeController', ..

  4. 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

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!