1

I have searched, but not finding my use case, although I would think it was a bit more common. Maybe I just dont know what to look for.

I Have an application with an unknown framework, and am slated to re-develop a couple features (sections) that use about 20 tables of old SQL data, which I'm converting to MySQL. The old code is aspx/access. I will need the aid of migration files to adjust this data to get it to work, since the conversion wont be clean, and I'm not a DB administrator per say, rather "full stack".

What I would "like" to do, is use Laravel Framework to build out these two features, one has a bunch of dropdown selector pages, the other is a questionnaire page/pages. Both of these sections need to be accessible in either one subfolder, or one subfolder for each, of the parent app, as some kind of include/require/autoload (not an iframe).

Also note, this Laravel site will be loaded in the content area, and sandwiched between the header and footer of the parent application, and loaded when the question/ and selector/ paths are used in the url. So essentially, for only the two paths on the site, I want Laravel to do the heavy lifting.

I already have a Laravel base app I'm working with on other projects so it should save me alot of time to use it in this mixed project. I'm just not sure what it entails to map the routes, and how to include the Laravel core framework into the parent application. I'm simply not sure how to integrate this framework into the parent app, or if this will work.

Im short on keywords to search for the solutions also. I can use some keywords. I saw modules, but im not sure thats what I'm looking for. I also see this stack article, which looks like one way to get the public out of the framework directory, which might be useful.

Why am I avoiding straight PHP? Because of the amount of tables, non standard field naming, and because I have a Laravel base app pre-configured for my environment and my tastes, which I have been working with on several projects lately, so am fairly fluent in it, etc..

Any suggestions on how to use Laravel to build some sections that are to be sandwiched in parent website? Will it work?

blamb
  • 4,220
  • 4
  • 32
  • 50
  • 1
    Here's some info: https://laravel-news.com/subfolder-install – Joseph Silber Sep 28 '17 at 17:04
  • 1
    Using a framework is probably the right call. "Straight PHP" is rarely straightforward for non-trivial projects. – tadman Sep 28 '17 at 17:08
  • I am not sure what scheme you are using to embed laravel in the middle of the page of your legacy web app. But let say you are using iframe, then certainly you could use the laravel 5 (full fledged without a need to delete any folder) for your need. All you have to do is create a routes in routes/web.php that will use laravel view for presenting the functionality in iframe and then when you are done the backend controller redirect to your parent sites. Probably more complex schemes of route is need but you get the idea where to start. – Andy Sep 29 '17 at 05:08
  • See my note (not an iframe), yeah I had thought that might be a good way, but iframes are a bit hackish, since we are in control of the source code of the entire app, the parent is a CMS. – blamb Sep 29 '17 at 17:59

1 Answers1

2

I would build the new Laravel app separately and use it as an API to present data for the existing app.

You can keep moving features over this way until finally you are only using the existing app as a 'front end' and it no longer has any business logic associated.

At that point, you can migrate the front end to Laravel views or a different front end framework.

kerrin
  • 3,376
  • 1
  • 26
  • 36
  • I don't have acces to the other app, I'm replacing the subsection however I can, and it needs to be able to simply be "plugged in" by the main site developer, as a `require` on their `index.php` when the path is found, I thought maybe the best way. It needs to be loaded via url path, which is all I have to trigger it with. – blamb Sep 29 '17 at 17:57