Download the PHP package leafs/aloe without Composer
On this page you can find all versions of the php package leafs/aloe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package aloe
Aloe CLI
Aloe is a CLI tool that comes with Leaf API and Leaf MVC v2 upwards. It ties into the Leaf console tool and totally replaces all it's functionality. Aloe exists at the root of your application in the leaf
script and provides a number of helpful commands that can assist you while you build your application. To view all available commands, you can use the list
command or call leaf
.
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, precede the name of the command with help:
Interact (REPL)
Aloe comes with aloe-interact which is basically powerful REPL powered by PSY Shell. Interact allows you to interact with your app, access variables and methods in your Leaf app, run and rollback migrations, perform database operations and so much more. You can access interact on aloe like this:
Writing Commands
Aside all the commands provided by aloe, you can also create your own commands and run them through the aloe cli. Aloe CLI allows you to directly generate commands to run in the CLI.
Generating Commands
To create a new command, you may use the g:command
aloe command. This command will create a new command class in the default commands directory.
The default directory for commands in Leaf API and Leaf MVC is App\Console
, with skeleton, you're free to decide where to place your commands.
Aloe can also generate namespaced commands directly for you. You don't have to manually set namespaces as done with other CLI tools.
If you want to, you can even generate the command by it's name instead of it's class. Aloe is smart enough to differentiate them.
Command Structure
After generating your command, you should start writing what to execute once the command is called. Aloe smartly generates a command name for you, even if you create the command using the class name, however, if it doesn't match what you need, you can always change it.
With the mail:send
example above, Aloe wil generate App\Console\MailSendCommand
, in this file, we'll have something that looks like this:
We can add an argument to find the user to send the email to, and output a message while sending the email.
Registering Commands
By default, aloe cli registers all commands generated, however, if you have a command you want to register manually, or commands from a package which need to use Aloe, you can also add them pretty easily.
Simply locate the aloe
file in the root directory of your project, open it up and find a commented section talking about custom commands.
An example command has already been registered, so you can follow this example. Simply call the register
method. You can also pass in an array of commands to register, as such, a custom package with a couple of commands to register can simply return an array of all those commands.
💬 Stay In Touch
📓 Learning Leaf 3
- Leaf has a very easy to understand documentation which contains information on all operations in Leaf.
- You can also check out our youtube channel which has video tutorials on different topics
- We are also working on codelabs which will bring hands-on tutorials you can follow and contribute to.
😇 Contributing
We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our contribution guide and you'll be ready to make your first pull request 🚀.
To report a security vulnerability, you can reach out to @mychidarko or @leafphp on twitter. We will coordinate the fix and eventually commit the solution in this project.
Code contributors
Michael Darko |
Pjotr Savitski |
Aminur Rahaman |
🤩 Sponsoring Leaf
Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on open collective or check the contribution page for a list of ways to contribute.
And to all our existing cash/code contributors, we love you all ❤️
Cash contributors
Aaron Smith |
Peter Bogner |
Vano |
🤯 Links/Projects
All versions of aloe with dependencies
leafs/fs Version 2.0
leafs/mvc-core Version *
psy/psysh Version ^0.10.9|^0.11
symfony/console Version ^5.0|^6.0
symfony/process Version ^5.0|^6.0