Laravel - Package Development - Routes
If your package contains routes, you may load them using the loadRoutesFrom
method. This method will automatically determine if the application's routes are cached and will not load your routes file if the routes have already been cached:
/**
* Bootstrap any package services.
*
* @return void
*/
public function boot()
{
$this->loadRoutesFrom(__DIR__.'/../routes/web.php');
}