Laravel Zero has you make your own command, so to my knowledge, you aren't building php artisan... commands, but instead your own self-contained binary (e.g. fly-laravel).
# If we renamed it "fly-laravel"
./fly-laravel list
The thing that builds it "for production" is
# or whatever you re-named it to
./application app:build
Registering the command
You shouldn't need to register a command with a service provider because this project itself produces a binary that creates the command.
The trick, then, is to setup the project in a way that gets Composer to add the binary to ./vendor/bin when installed in a Laravel project or ~/.composer/vendor/bin if installed globally on someones machine.
Our Readme now contains instructions on aliasing ./vendor/bin/fly-launch, here , please close this issue if we no longer need to look into how we can allow the users run the fly-laravel launch command.
Generating Docker files has also been added in this PR
Laravel Zero has you make your own command, so to my knowledge, you aren't building
php artisan...
commands, but instead your own self-contained binary (e.g.fly-laravel
).This project's command is simply
application
right now (bc of this file: :https://github.com/fly-apps/fly-laravel/blob/main/application ).So, you'd run commands in development like this:
Note that we see all our commands available here:
You can rename that via
./application app:rename <foo>
(see here: https://laravel-zero.com/docs/installation )After renaming it, you can then do things like:
The thing that builds it "for production" is
Registering the command
You shouldn't need to register a command with a service provider because this project itself produces a binary that creates the command.
The trick, then, is to setup the project in a way that gets Composer to add the binary to
./vendor/bin
when installed in a Laravel project or~/.composer/vendor/bin
if installed globally on someones machine.To my knowledge, this is how: https://laravel-zero.com/docs/build-a-standalone-application
(I haven't done that process yet myself in my own projects to see!)
Docker Stuff
The
Dockerfile
references Octane - those files are built into the base Docker image, in this repo: https://github.com/fly-apps/laravel-docker