Adding a route in Laravel as the last route, from a composer module?Laravel controllers and routes in packages?Laravel dynamic routesLaravel Custom User Roles & Permissions based on routesLaravel 5 Route Model Binding not working on serverLaravel 5, calling function inside compose@ViewComposer logs fatal error and returns result as expectedGlobal route in Laravel 5routing rules and orders in laravel 5Laravel 5.2 error message not shownLaravel 5.4 Modules: NotFoundHttpException in RouteCollection.php line 161Custom Tool is not showing View, Laravel Nova
Holes in Wall of Force
How is the Apple Watch ECG disabled in certain countries?
Can you cure a Gorgon's Petrifying Breath before it finishes turning a target to stone?
Calculate the Ultraradical
Isn't the detector always measuring, and thus always collapsing the state?
Impossible violin chord, how to fix this?
Lost passport and visa, tried to reapply, got rejected twice. What are my next steps?
Is it possible to take a database offline when doing a backup using an SQL job?
How big would the ice ball have to be to deliver all the water at once?
Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails
How to compare integers in TeX?
How does Monks' Improved Unarmored Movement work out of combat?
How to study endgames?
Should I be an author on another PhD student's paper if I went to their meetings and gave advice?
How deep is the liquid in a half-full hemisphere?
Is the "spacetime" the same thing as the mathematical 4th dimension?
Would an object shot from earth fall into the sun?
How to level a picture frame hung on a single nail?
Why most footers have a background color has a divider of section?
Realistically, how much do you need to start investing?
Implementation of a Thread Pool in C++
Why is STARTTLS used when it can be downgraded very easily?
Is it possible for a company to grow but its stock price stays the same or decrease?
Can a passenger predict that an airline is about to go bankrupt?
Adding a route in Laravel as the last route, from a composer module?
Laravel controllers and routes in packages?Laravel dynamic routesLaravel Custom User Roles & Permissions based on routesLaravel 5 Route Model Binding not working on serverLaravel 5, calling function inside compose@ViewComposer logs fatal error and returns result as expectedGlobal route in Laravel 5routing rules and orders in laravel 5Laravel 5.2 error message not shownLaravel 5.4 Modules: NotFoundHttpException in RouteCollection.php line 161Custom Tool is not showing View, Laravel Nova
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am making a module for Laravel, and for the ease of reusability, I am making it as a separate composer module.
In this module, I have to define a catch-all route, but I dont want it to override any of the manualy added routes, in the project.
Does anyone have a good idea how I can get this behaviour?
I am registering my route in the ServiceProviders boot() method like this:
public function boot()
$this->loadMigrationsFrom(__DIR__.'/migrations');
$this->loadRoutesFrom(__DIR__.'/routes/routes.php');
and the routes.php is also rather simple:
$regex = ".*";
Route::namespace('Asator\Runepost\Controllers')
->middleware(['web', DynamicContent::class])
->group(function($route) use ($regex)
$route->any('any', 'RunepostFrontController')->where('any', $regex);
);
Is it possible to somehow add the route as the last route, after the manually added routes has run?
laravel laravel-routing
add a comment
|
I am making a module for Laravel, and for the ease of reusability, I am making it as a separate composer module.
In this module, I have to define a catch-all route, but I dont want it to override any of the manualy added routes, in the project.
Does anyone have a good idea how I can get this behaviour?
I am registering my route in the ServiceProviders boot() method like this:
public function boot()
$this->loadMigrationsFrom(__DIR__.'/migrations');
$this->loadRoutesFrom(__DIR__.'/routes/routes.php');
and the routes.php is also rather simple:
$regex = ".*";
Route::namespace('Asator\Runepost\Controllers')
->middleware(['web', DynamicContent::class])
->group(function($route) use ($regex)
$route->any('any', 'RunepostFrontController')->where('any', $regex);
);
Is it possible to somehow add the route as the last route, after the manually added routes has run?
laravel laravel-routing
add a comment
|
I am making a module for Laravel, and for the ease of reusability, I am making it as a separate composer module.
In this module, I have to define a catch-all route, but I dont want it to override any of the manualy added routes, in the project.
Does anyone have a good idea how I can get this behaviour?
I am registering my route in the ServiceProviders boot() method like this:
public function boot()
$this->loadMigrationsFrom(__DIR__.'/migrations');
$this->loadRoutesFrom(__DIR__.'/routes/routes.php');
and the routes.php is also rather simple:
$regex = ".*";
Route::namespace('Asator\Runepost\Controllers')
->middleware(['web', DynamicContent::class])
->group(function($route) use ($regex)
$route->any('any', 'RunepostFrontController')->where('any', $regex);
);
Is it possible to somehow add the route as the last route, after the manually added routes has run?
laravel laravel-routing
I am making a module for Laravel, and for the ease of reusability, I am making it as a separate composer module.
In this module, I have to define a catch-all route, but I dont want it to override any of the manualy added routes, in the project.
Does anyone have a good idea how I can get this behaviour?
I am registering my route in the ServiceProviders boot() method like this:
public function boot()
$this->loadMigrationsFrom(__DIR__.'/migrations');
$this->loadRoutesFrom(__DIR__.'/routes/routes.php');
and the routes.php is also rather simple:
$regex = ".*";
Route::namespace('Asator\Runepost\Controllers')
->middleware(['web', DynamicContent::class])
->group(function($route) use ($regex)
$route->any('any', 'RunepostFrontController')->where('any', $regex);
);
Is it possible to somehow add the route as the last route, after the manually added routes has run?
laravel laravel-routing
laravel laravel-routing
asked Mar 28 at 20:07
Dennis NielsenDennis Nielsen
134 bronze badges
134 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
Just add your module's ServiceProvider after the App's RouteServiceProvider in config/app.php and make sure your catch-all-route is the last route of your module's routes.
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406038%2fadding-a-route-in-laravel-as-the-last-route-from-a-composer-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just add your module's ServiceProvider after the App's RouteServiceProvider in config/app.php and make sure your catch-all-route is the last route of your module's routes.
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
add a comment
|
Just add your module's ServiceProvider after the App's RouteServiceProvider in config/app.php and make sure your catch-all-route is the last route of your module's routes.
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
add a comment
|
Just add your module's ServiceProvider after the App's RouteServiceProvider in config/app.php and make sure your catch-all-route is the last route of your module's routes.
Just add your module's ServiceProvider after the App's RouteServiceProvider in config/app.php and make sure your catch-all-route is the last route of your module's routes.
answered Mar 28 at 22:45
jakub_jojakub_jo
7746 silver badges17 bronze badges
7746 silver badges17 bronze badges
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
add a comment
|
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
oh yes, that could do it thanks :) I am using auto-discovery in composer.json, do you know of a way to prioritize how it discopvers it? Otherwise I will just have to add it manually, it would just be cool if possible :)
– Dennis Nielsen
Mar 29 at 11:42
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
See Taylor's medium post on how to disable autodiscover for particular packages: medium.com/@taylorotwell/…
– jakub_jo
Apr 1 at 13:20
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406038%2fadding-a-route-in-laravel-as-the-last-route-from-a-composer-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown