can i add laravel in composer.json and use it in concrete5

Permalink
Hi
just asking if i add laravel in composer.json and download its dependencies does it will load automatically ?
is so can i use it in my single pages programming and other stuff in concrete5?
thanks in advance.

 
Mnkras replied on at Permalink Reply
Mnkras
concrete5.7 has laravel built in, in 5.6 it would take a little bit of work to get that going.
macnux replied on at Permalink Reply
im on 5.7 can i load and use other laravel components ? how?
im just adding it to composer.json and update dependencies and what after that?
Mainio replied on at Permalink Reply
Mainio
concrete5 comes only with the following components from Laravel
illuminate/container
illuminate/config

But it's certainly not "built in" as a whole.

I would suggest creating a concrete5 package, where you create your own composer.json to load the other components you need from Laravel.

Making your views work with Laravel controllers is certainly possible but might require some work.

We currently have an ongoing project where we're integrating Symphony form components and the Twig templating system (in order to use the forms easily) into the concrete5 context. The first one was pretty easy but the latter (Twig templates) required us to create our own View classes and own Controller class to load the View classes properly. Wasn't hard either but it couldn't be done with the core only.

Once we get this fully working, we'll publish it into GitHub.
macnux replied on at Permalink Reply
so its not that easy that i can load other laravel components into the built in composer.json to use it
and i have to wait the project you mentioned
Mainio replied on at Permalink Reply
Mainio
No, the project was just an example on what we've experienced. It does not relate to this particular issue in any way.

Why I suggested adding your own c5 package where you would have your own composer.json is that this way your changes would be preserved when concrete5 is updated. If you modify the core composer.json, all your changes will be gone when you update concrete5.
macnux replied on at Permalink Reply
ok suppose that i will work with my own concrete5 without worrying about updates
what i should do after adding it to composer.json?
Mainio replied on at Permalink Reply
Mainio
Either use the Laravel's own router for your custom paths as per Laravel's documentation or create your own View and Controller classes to do whatever you want.

I really don't have any deep experience of Laravel so I'm not sure how easily you can modify the paths where it loads the controllers and views but I would guess it's possible. If not, you'll need to create your own Views and Controllers that handle the stuff you need to handle through the Laravel libraries.

Or if there is some specific thing you need from Symfony, you might not even need to do anything else than use that library in your concrete5 controller.
Mainio replied on at Permalink Reply
Mainio
Actually, on a second thought, you might not even need to modify the concrete5's own Controller and View classes at all if you use the Laravel's own router. You just need to figure out how to tell it where your controllers and view files are located at.
macnux replied on at Permalink Reply
ok please could you tell me how to do this after i install laravel from composer.json
Mainio replied on at Permalink Reply
Mainio
As I said, I basically have no deep experience of Laravel.

I suggest starting from the Laravel docs:
http://laravel.com/docs/4.2/quick...

Onwards from the Routing part.

I have no idea of what you're trying to do, so I cannot help you there any further.

Also keep in mind that combining two frameworks like this might hit you back in several ways. E.g. having the overhead from two completely separate frameworks. You might want to only bring those components from Laravel that you really need to avoid adding unnecessary overhead.