how to connect two projects Laravel 4.2 and laravel 5.5? - laravel

i have a laravel 4.2 project that i want to connect it to laravel 5.5 project
Q1) how to login in the first and and authenticated to the second to so i don't have to login to the second
Q2)how to connect them to the same DB
Q3)let's say i'm in page X in laravel 4.2 and i want to direct it to Y in laravel 5.5 where i should write the route in laravel 4.2 or in 5.5 ?
at the end both of the projects are going to be on the same server and have the same domain if that is going to be helpful

Q1) how to login in the first and and authenticated to the second to so i don't have to login to the second
if the 2 webapp are in the same domain, it should not be an issue
especially if they use the same database.
Q2)how to connect them to the same DB
just use the same credentials and save it on each env file.
Q3)let's say i'm in page X in laravel 4.2 and i want to direct it to Y in laravel 5.5 where i should write the route in laravel 4.2 or in 5.5 ?
you can use the function route instead use the manual routing like
to('somepage-on-theother-laravel') this is a tedious work. So i want
to ask if why are you using the 2 webapp in the same domain instead of
just using 1 webapp framework. Im thinking that this laravel 4.2 is
the existing one and you're create a new one and you want to use the
laravel 5.5 right?

This is easy to do, just put both applications on the same server and link them using the same credentials in the .ENV file, don't forget you will also need to create Models in both apps so that both apps can use the tables.
As for the routes, you would need to add the routes & functions that can be called in each individual app.
So if the user clicks the URL for /link-to-4.2 you should have a route in 4.2:
Route::get('/link-to-4.2', 'index#controller');
and then in your 5.5 you should have a route for any URLs that direct to anything there. i.e: /link-to-5.5
Route::get('/link-to-5.5', 'index#controller');
this all being said, what is the justification for using 2 apps? I think there could be a number of security issues that might cause headaches, this will also likely be a real nightmare to manage moving forward.
I would strongely suggest that you just upgrade the 4.2 app to be 5.5.

Related

Does soft deletes works on lumen framework? Limitations of Lumen?

I just wanted to know soft deletes on laravel is also works with lumen framework?
what are the limitations of lumen framework compared to laravel?
we are going to start a project with micro-services concept and considering about lumen framework.
Yes, SoftDeletes are supported in Lumen.
The limitations are:
Configuration is different (not everything is out the box)
The routing is very basic
Missing useful artisan commands and helpers
some additional Laravel packages won't work
missing sub-domain routing, no optional parameters in routes
So basically you are using a stripped down version of Laravel and you are missing flexibility.

Intergrate Laravel Library in Codeigniter Project

I have one library in laravel :-
https://github.com/mjaschen/collmex
I want to integrate it in my Codeigniter project, Can anyone help me in it?
since both use composer, you can simply require it.
but since you can't use service providers...you have to call them manually (i.e. you won't get access to alias in laravel) except that...you can do everything as in laravel project.

how to use laravel illuminate in a custom project

I have a static site with a lot of pages. Now I got a new requirement. Client need a Client Area, I am thinking to use laravel Database Eloquent, Session, Form/html, Session and want to use them as alias like use in laravel/lumen. The problem is that I want static pages same as it is with .html extension, is there any solution? I want some packages with aliases to speed up.
I spent a complete day on Configuring Input and Eloquent but I wasn't able to setup to other packages. But I don't know how to set aliases and service providers. Any idea?
Specific:
I need Laravel Some packages
Session,
FileSystem
Mail
Input
Database
Html/Form,
Validation
I don't need others packages and need aliases same as laravel used in (config/app)
yes you can use laravel components outside laravel project please read the article : http://www.richardbagshaw.co.uk/using-illuminate-components/

Getting a laravel script ready for clients

I'm developing a paid application that is based on laravel. I want ideas about how to package the app and how to decrease laravel file size and get rid of all laravel components that is of no use on production/every case, for example: Boris , Predis and maybe Swift email .. What is the proper way to remove them and what other parts of laravel can be removed with no effects?
Scripts could be used in shared hosting or by people with minimum and tech knowledge .. So, it should be easy for them

gradually migrate application from codeigniter to Laravel

I have a quite large application written in Codeigniter 1.7.
It needs some significant enhancements and I have been evaluating Laravel 4 as the PHP framework.
I am trying to find out if anyone has successfully extended an existing Codeigniter application using Laravel so that some screens are Laravel and some are Codeigniter.
I imagine that authentication (currently using Ion Auth) and Session management (using mysql backend) would be two major hurdles to overcome.
If this is an option then I will explore in more detail as the amount of legacy code needing transferring is considerable.
Thanks in advance.
I suppose in your Laravel routes file, create a route for every page you have written in CodeIgniter. Route everything to the URL that CodeIgniter is expecting and as you complete portions in Laravel, change the routes to point to the correct ones Laravel expects as you go.
Before you do anything though, I'd get everything you need for authentication finished in Laravel, turn authentication off in CodeIgniter, and just let Laravel handle that in the routes.

Resources