Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple apps / projects with one Laravel 4 installation

i'm have worked with laravel 3 in the past and used a project structure where multiple apps could use one installation of the framework. now in laravel 4 i am concered if that is still possible. since the bootstrap/autoload.php file requires the vendor/autoload.php file (and so on...), different apps have to use the same autoload files from within the vendor directory, right? i think this would be a big performance problem because the different apps maybe have different requirements, different models to work with and so on. am i thinking right or is there a chance to use one /vendor/ installation for multiple apps without the need to share the autoload files?

to explain my needs: i would like to run different apps (every app with another domain & home directory) which share one database and some models. but the requirements of every app will be very different.

is there any solution? i tried this since the release but found no practicable way.

like image 620
marvin Avatar asked Jun 06 '13 08:06

marvin


People also ask

How do I run two different laravel projects?

First, run your first Laravel project blog as follows: Open your command prompt and go to your drive where your Laravel project exists. Now type http://localhost:8000 in the browser and your blog project will run. Now go to your browser and type http://localhost:8080 in your browser your another project will also run.


2 Answers

Have you tried http://laravel.com/docs/routing#sub-domain-routing?

You could create a route group and assign a filter function to that route group to do specific autoloads?

like image 71
priyolahiri Avatar answered Nov 04 '22 00:11

priyolahiri


How about modifying bootstrap/autoload.php and vendor/autoload.php to load autoload stuff per project to some kind of sub-directory structure under vendor/composer/.

Not sure, how to change composer to generate that kind of project specific autoload directories. Maybe it needs changing composer?

like image 28
trm42 Avatar answered Nov 04 '22 01:11

trm42