Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda