Support the ongoing development of Laravel.io →
Architecture
Last updated 1 year ago.
0

Don't put the app running on two frameworks or some similiar, it will become really painful to maintain, start migrating and put all on laravel when it's done, without half transitions.

Just my 2 cents.

Last updated 1 year ago.
0

This is a pretty large complex business-application. Migration will take several months to complete. It is also in constant development with new features.

I am looking at different approaches:

  • Get Eloquent to work in Cake as a first step
  • Get Laravel router to dispatch CakeControllers and Views so we can migrate businessmodule by businessmodule
  • Also an option is to make an Laravel API of the business-logic.
Last updated 1 year ago.
0

Although this doesn't help with the question, I have to ask - why?

What benefits are you going to get from Laravel that Cake doesn't provide? Sure there might be things which Laravel does better and makes easier, but is the months of development time and money worth that - as you'll be able to do anything in Cake which Laravel can do, just how it's done is different.

I ask this, because a company I also work with thought about doing this but said no as there were no massive benefits for the dev time involved.

Last updated 1 year ago.
0

If you read my first post, you will see that just upgrading our project to cake 3.0 will take many hours, since alot in model layer has changed. So I am not sure the amount of work is that different.

My real question here is if it is possible to wrap a cakeApp inside Laravel in the transision period, or vice versa.

Last updated 1 year ago.
0

Yes, you can have one site running on both frameworks at once without having them step on each other. I've done this before by:

  1. Creating a single config.php at the top level with some globals in it, then modifying the config in Laravel and Cake so that they use those globals (so the database, etc, only need to be entered in one place)
  2. Combining the databases (this is the part where things may go awry--if you have tables that have the same names you'll have problems. In my case only the "users" tables collided, and we found that their fields meshed well when you combined their data)
  3. Create a single "public" folder that laravel/public and cake/app/webroot point to, then have Apache serve that
  4. Have laravel and cakePHP use their own "index.php" files to kick-start themselves, but make public/index.php a file that knows which routes go to which frameworks and routes requests accordingly, like:
<?php 

require_once('../config.php');

if (preg_match("/^\/(user\/|admin|app|content|wall)/", $_SERVER['REQUEST_URI'])) {
    require_once('../laravel/index.php');
} else {
    require_once('../cake/index.php');
}
Last updated 9 years ago.
0

Hi dslawrence

Could you please provide more in-depth details about the steps ? specially about step 3 and 4 ?

Last updated 8 years ago.
0

@amrigo

3 step could be accomplished with a simple symlink (assuming the os is linux):

project/
-- laravel
--- public/ -> symlink to ../public
-- cakephp
--- webroot/ -> symlink to ../public
-- public/
--- index.php <- as shown in 4 step.

Then apache vhost config webroot should point to project/public.

0

@dslawrence How can you get the cakephp session in order to keep the user authenticated from cakePHP to Laravel ?

0

May i ask what are the targets you're trying to achieve by migrating to Laravel?

0

@astroanu in my case the cakephp app have many modules and the migration to version 3 would not be so fast as the development in Laravel. So i need to migrate module by module to laravel and then turn off cakephp. Only need to discover how to maintain the login routing from cake to laravel or from laravel to cake.

0

I see then the method described by @dslawrence would definitely work. It is dirty but will work.

0

In my situation i would like that a cakephp session would be valid to generate a login into laravel, just can not see the way this can be done, if it can be done.

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2024 Laravel.io - All rights reserved.