laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

[Proposal] Add Laravel packages on creating a new project #1987

Open regiszanandrea opened 4 years ago

regiszanandrea commented 4 years ago

Hi,

I would like to implement an option to laravel/installer new command that install Laravel's packages after project creation.

The packages should be restrict to Laravel ecosystem, excluding paid projects (like nova). The option name that I thought initially was with, but I am open to suggestions.

An example: $ laravel new blog --with=ui,horizon,telescope,socialite

But before, I would like to listen some opinions from community.

mouadziani commented 4 years ago

@regiszanandrea Great Idea 👍

julienbourdeau commented 4 years ago

Excellent one! Especially if it adapts default configuration (like if you add passport, it's automatically set in config).

regiszanandrea commented 4 years ago

@julienbourdeau Yes, I thought that too. Like:php artisan telescope:install. But Passport requires more things to install it completely, I don't know what should be the best practice in Passport case.

HapLifeMan commented 4 years ago

This is an awesome idea.

🙌🏻

nowendwell commented 4 years ago

Just a heads up if this doesn't get adopted, Lambo by Tighten is an awesome alternative.

https://github.com/tightenco/lambo

mattstauffer commented 4 years ago

The way Lambo works, if anyone is curious, is that you make an "after" file that allows you to require packages.

So your "after" file might look like this:

composer require tightenco/ziggy
mkdir bin
touch bin/setup.sh
touch bin/install.sh
chmod +x bin/setup.sh
chmod +x bin/install.sh
# Do other stuff here

And then every time you run the Laravel installer with lambo myProject those lines will also be run.

It's not in the native installer, and, unlike this suggestion, it's not customizable with command line flags, so it's definitely not the same. But just FYI. Thanks for the mention, @nowendwell.

dillingham commented 4 years ago

That would be awesome for every official package. Nova etc. would the install commands and migrations run automatically? Maybe each package has a bash file in root for this occasion if their post composer steps differ greatly.

regiszanandrea commented 4 years ago

@dillingham I'm implementing the option to run install commands only, to run migrations you must configure your database environment variables in your .env.

regiszanandrea commented 4 years ago

Hey guys, I created a pull request for this: https://github.com/laravel/installer/pull/109

I appreciate any feedback, thanks :)