Skip to content

Instantly share code, notes, and snippets.

@iradofurioso
Created June 15, 2019 23:49
Show Gist options
  • Save iradofurioso/96995eb8e40bae811e23c60d8361b7ef to your computer and use it in GitHub Desktop.
Save iradofurioso/96995eb8e40bae811e23c60d8361b7ef to your computer and use it in GitHub Desktop.
Laravel: Removendo o prefixo '/api/' da URL | Removing /api/ prefix from URL
//File: app\Providers\RouterServiceProvider.php
// Removing prefix line | removendo a linha de prefixo
//Mudar | Change
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
// para | to
protected function mapApiRoutes()
{
Route::middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment