PHP code example of hydreflab / laravel-make-me

1. Go to this page and download the library: Download hydreflab/laravel-make-me 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/ */

    

hydreflab / laravel-make-me example snippets




class MyAwesomeMakeCommand extends \Illuminate\Console\Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'make:awesome';
    

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new awesome class';
    

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        // Generate something awesome
    }
    
    /**
     * Get the console command arguments.
     *
     * @return array
     */
    protected function getArguments()
    {
        return [
            ['name', InputArgument::REQUIRED, 'Your awesome name'],
        ];
    }
    
    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            ['scale', 's', InputOption::VALUE_NONE, 'Awesomeness scale.'],
        ];
    }
    
    /**
     * Collect options for the interactive make command.
     * 
     * @return array
     */
    public function collectInputForInteractiveMake()
    {
        return [
            'name' => $this->ask('What is your name, awesome?'),
            '-s' => $this->ask('How awesome are you?', 10),
        ];
    }
}
bash
php artisan make

php artisan make --list