Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/dashboard';
protected $namespace = "App\\Http\\Controllers"; // add this
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
// ...
$this->routes(function () {
Route::middleware('web')
->namespace($this->namespace) // add this
->group(base_path('routes/web.php'));
Route::prefix('api')
->namespace($this->namespace) // add this
->middleware('api')
->group(base_path('routes/api.php'));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment