0

I have a laravel install, setup as a new CMS.

The frontend of the site is a pretty complex old website. The new CMS is going to take over a portion of it, but migrating everything to Laravel isn't an option.

I understand that I can use https://packagist.org/packages/illuminate/database to enable Eloquent and make database queries. However, what this doesn't include is the models I've already created as part of the CMS.

So on the same server I have:

  • /var/www/laravel-cms/ <- Laravel based CMS
  • /var/www/website.com/ <- Custom PHP Project

How can I use my models created in laravel-cms on website.com?

Lex
  • 113
  • 9

2 Answers2

0

Is there anything stopping you from copying ( or perhaps simlinking) your legacy models into the /var/www/laravel-cms/app directory and then using namespaces to call those models from the the controller?

namespace App\Http\Controllers;
...
use App\Legacy-Models\Model1 as Example;

class ExampleController extends Controller {
    public function index() {
        $ex = new Example();
...
mconkin
  • 121
  • 7
-1

You can create some method in your Laravel controller using the Laravel model. then call the function from website.com using Curl.