All Projects → HydrefLab → laravel-make-me

HydrefLab / laravel-make-me

Licence: MIT license
Extendable Interactive Make Command for Laravel

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-make-me

cache
Laravel & Lumen Cache Service | File and Redis cache system
Stars: ✭ 19 (-47.22%)
Mutual labels:  laravel5
strip-ansi-stream
Strip ANSI escape codes
Stars: ✭ 32 (-11.11%)
Mutual labels:  console
phantomic
Pipe stdin to Phantom.JS
Stars: ✭ 20 (-44.44%)
Mutual labels:  console
pelt-testing
A library testing for python, this package allows us to test algorithms and generate test data.
Stars: ✭ 14 (-61.11%)
Mutual labels:  console
captcha
😁一个Laravel5使用的简单图形验证码组件包
Stars: ✭ 13 (-63.89%)
Mutual labels:  laravel5
fancyline
Readline-esque library with fancy features
Stars: ✭ 72 (+100%)
Mutual labels:  console
kube-design
Kube Design for KubeSphere Console
Stars: ✭ 88 (+144.44%)
Mutual labels:  console
opencv3-setup
Raspberry Pi whiptail Menu driven Easy Install and Compile of opencv3 python from source files.
Stars: ✭ 47 (+30.56%)
Mutual labels:  make
t-rex-game-bot
A bot that plays the Google Chrome T-Rex game for you
Stars: ✭ 60 (+66.67%)
Mutual labels:  console
colored-console
🌈 Add some color to your console >_
Stars: ✭ 74 (+105.56%)
Mutual labels:  console
generator
A Laravel Module Generator Package for Laravel AdminPanel <https://github.com/viralsolani/laravel-adminpanel>
Stars: ✭ 19 (-47.22%)
Mutual labels:  laravel5
tty-screen
Terminal screen detection - cross platform, major ruby interpreters
Stars: ✭ 78 (+116.67%)
Mutual labels:  console
console-web-ui
Examples to show case how to build web based UI (that can be invoked using curl) for console applications using Javascript(NodeJS)
Stars: ✭ 28 (-22.22%)
Mutual labels:  console
Segnalibro
Save and comment your favorite links from the web. It's just a bookmarking application.
Stars: ✭ 14 (-61.11%)
Mutual labels:  laravel5
react-native-console-time-polyfill
console.time and console.timeEnd polyfill for react-native
Stars: ✭ 92 (+155.56%)
Mutual labels:  console
capybara-chromedriver-logger
Enables console.log/error/info output from Javascript feature specs running with Chromedriver
Stars: ✭ 54 (+50%)
Mutual labels:  console
teletype.js
A hyper-text terminal for web browsers.
Stars: ✭ 18 (-50%)
Mutual labels:  console
Lua-Obfuscator
Obfuscate your lua code because it's so easy to steal!
Stars: ✭ 69 (+91.67%)
Mutual labels:  console
tvoip
Terminal-based P2P VoIP application (TeamSpeak-/Skype-like voice chatting over LAN or Internet)
Stars: ✭ 34 (-5.56%)
Mutual labels:  console
xontrib-output-search
Get identifiers, paths, URLs and words from the previous command output and use them for the next command in xonsh shell.
Stars: ✭ 26 (-27.78%)
Mutual labels:  console

Extendable Interactive Make Command for Laravel

Make your life easier with interactive make command!

Installation

composer require hydreflab/laravel-make-me

Laravel >= 5.5

Package uses Laravel auto-discovery feature, so no service provider registration is needed.

Laravel <= 5.4

Manual service provider registration is required in config/app.php:

'providers' => [
    // ...
    
    HydrefLab\Laravel\Make\MakeServiceProvider::class,
]

Note: PHP >= 7.0 is required to run this package

Usage

To use interactive make, just run:

php artisan make

After that, you'll be asked what kind of class do you want to generate. Then, you'll be asked a series of questions in order to prepare class that suits your needs.

Interactive make integrates all default Laravel generator commands.

If you want to check what's available, simply run:

php artisan make --list

Why

Laravel's Artisan is a great tool. Laravel's generators (make) commands are great tools. Quite often they have a lot of additional options available. However, without checking out the command's code or run command with --help option, it is a mystery what additional stuff particular command can do. That's why I created this interactive make command. Enjoy!

[Edit]: I recently noticed that there is a similar package that also adds interactive make. Check that out, maybe it will suit you better.

Preview

Preview

Extendability

Quite often, as project advances, you end up in a situation that you're creating your own generator commands, your own make:something. It would be awesome if this new command could be included in the interactive make. Hey, that's possible.

To add custom (non-default) generator command to the interactive make:

  • command has to have public collectInputForInteractiveMake() method implemented,
  • collectInputForInteractiveMake method must return an array,
  • command must extend Illuminate\Console\Command class (since it is make-like command, I recommend to extend Illuminate\Console\GeneratorCommand),
  • command name must contain make: prefix, for example make:awesome.

Example:

<?php

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),
        ];
    }
}

That's it. MyAwesomeMakeCommand command will now be included in the interactive make as awesome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].