Support the ongoing development of Laravel.io →
Configuration Packages Architecture

We've been using Laravel for our front-end architecture with some success for awhile. Now we need to manage a back-end side of our application.

I've created another Laravel project that depends on the front end project, which lets me access the models and miscellaneous classes I need in the back end. However, I'm running into issues with configuration and routing.

For example, one of my back end classes sends a tweet containing a link (to the front end site, of course). It needs to know the routes for the front end in order to do this properly. Is there any way to get the route for the dependent project from within the currently running application?

Example code on the back end:

function sendTweet(MyModel $model) {
  $front_end_url = $front_end_config->getUrlGenerator()->route('model.show', [$model->id]);
  $this->twitter->tweet("See this page: $front_end_url");
}

In this case, I'd like to have "$front_end_config" use the routing configuration for the dependency, rather than the currently-running application. I'm not afraid of using external libraries to make this work, I just need to be able to get the dependent app's configuration, routing, etc.

Thanks!

TL;DR can I get a dependent app's routes and configuration from within another app?

Last updated 3 years ago.
0

AFAIK there's no way to do this. You'd have to load the front end routes into your back end app which is... interesting.

Do you really need it to be 2 separate sites? Why not just /admin?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

slushie slushie Joined 4 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.