PHP code example of leafs / aloe

1. Go to this page and download the library: Download leafs/aloe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leafs / aloe example snippets



namespace App\Console;

use Aloe\Command;

class ExampleCommand extends Command
{
    protected static $defaultName = "mail:send";
    public $description = "mail:send command's description";
    public $help = "mail:send command's help";

    public function handle()
    {
        $this->comment("mail:send command's output");
    }
}


public function config()
{
    $this->setArgument("user", "'user');

    $this->comment("Sending email to $user");

    $success = \CustomEmailHandler::send($user);

    if ($success) {
        $this->info("Email sent successfully");
    } else {
        $this->error("Couldn't send email, pls try again");
    }
}

/*
|--------------------------------------------------------------------------
| Add custom command
|--------------------------------------------------------------------------
|
| If you have a new command to add to Leaf
|
*/
$aloe->register(\App\Console\ExampleCommand::class);

$aloe->register([
    \App\Console\AppCommand::class,
    CustomPackage::commands(),
]);
sh
php leaf list
# or
php leaf
sh
php leaf help db:migrate
sh
php leaf interact
sh
php leaf g:command SendMail
sh
php leaf g:command mail:send
sh
php leaf g:command shutdown