Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda