Support the ongoing development of Laravel.io →
Installation Configuration Architecture

I'm using Laravel for a year now and really love it. I'm using it for my job and now, a year passed and 100% of the projects I'm doing are now built on Laravel. As I'm doing a couple of sites a year, I'm always trying to improve my workflow. Especially when starting a new project.

I use Yeoman a lot (Bower + Grunt + Yo for scaffolding) and I've managed to use it even with laravel projects. The only problem (well this is not really a problem because I already have a solution) is related to starting a new project.

I have made a Yeoman generator to create the skeleton of a new project (https://github.com/Folkloreatelier/yeoman-generator-laravel). Basically what I'm doing is fetching the laravel repository from github, then I fetch a repository on my github (https://github.com/Folkloreatelier/yeoman-boilerplate-laravel) with some base files that are commons to all my projects (javascript, base css, ...) and also some files that will overwrite the laravel files (in the app folder) with my tweaks (configuration, filters, base routes, ...). And finally, I fetch another repository similar to the other if the website contains an administration sections (https://github.com/Folkloreatelier/yeoman-boilerplate-laravel-admin). This repository contains also commons files (js, css, ...) and also overwrites laravel files in the app/ folder to pre-configure some things.

This works fine. But I can't stop asking myself if this would be better to move all this in packages. I could have a packages for the commons files I'm using, a package for my base administration section, and packages for some other functionalities. The major reason why I think it could be better that way is to upgrade an existing website with a newer versions of, for example, my administration panel. The reasons why I'm not already doing this is I can't figure how to use packages and still be able to customize the website for it's specific needs.

The most concrete example I can think of to explain my concerns is: if I make a package for my administration panel that contains a basic sections to manage users. I know that in 80% of the projects, it will be the same form to create or edit the users. But if for a project I want to add a field for the cellphone number. Doing it the packages way, will require me to find a way to by pass the form view contained in my package, the controller method to save and validate the new field, etc... because I cannot directly edit the files in the vendor folder. While doing it like i'm doing right now, only requires me to edit that view in my app/views/admin/ folder and the controller in app/controllers

So my question is for people who are using Laravel in a production context. How do you deal with that? What is your workflow when you start a new project? How do you reuse your configuration/functionnalities/structure you develop overtime?

Thanks

Last updated 3 years ago.
0

Packages is the way to go, especially for modules like your administration panel. Since it will be in your vendor directory, you can treat it like a separate project with proper version control. Use a branching workflow like this - http://nvie.com/posts/a-successful-git-branching-model/ to maintain upgrades and merge them back upstream to your package for future use.

Last updated 3 years ago.
0

Yes, packages are certainly the way to go here. What I'm currently working on is a yeoman generator that will use prompts to allow the user to specify which packages they'd like to include in the initial composer.json before yeoman runs composer install. With that model in mind, you could pre-fill your packages and just check off the ones you'd like to include.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

dmongeau dmongeau Joined 24 Mar 2014

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.

© 2025 Laravel.io - All rights reserved.