Coder Social home page Coder Social logo

thettler / laravel-console-toolkit Goto Github PK

View Code? Open in Web Editor NEW
31.0 31.0 1.0 663 KB

This Package provides some usefully console features like the attribute syntax for arguments and options, validation, auto ask and casting.

License: MIT License

PHP 100.00%
artisan artisan-command console laravel laravel-package php

laravel-console-toolkit's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar thettler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gavin-good

laravel-console-toolkit's Issues

"$__not_provided__$" when on option without a default

I would expect that not to be shown as I didn't define a default.

image

<?php

namespace App\Console\Commands\Database;

use Illuminate\Console\Command;
use Thettler\LaravelConsoleToolkit\Attributes\Argument;
use Thettler\LaravelConsoleToolkit\Attributes\ArtisanCommand;
use Thettler\LaravelConsoleToolkit\Attributes\Option;
use Thettler\LaravelConsoleToolkit\Concerns\UsesConsoleToolkit;

#[ArtisanCommand(name: "create")]
class CreateDatabaseCommand extends Command
{
    use UsesConsoleToolkit;

    #[Argument]
    public string $project_name;

    #[Argument]
    public string $database_name;

    #[Option(description: "Memory in Mi")]
    public int $memory;
    #[Option(description: "CPU in millicores")]
    public int $cpu;
    #[Option(description: "Storage in Mi")]
    public int $storage;
    #[Option(description: "Replicas")]
    public int $instances = 1;

    public function handle(): void
    {
        
    }

}

AutoAsk not available for required options

When defining required arguments are not supplied auto-ask works just fine. (Awesome feature btw)

However, the same does not apply to required options. Is this behaviour desired or a bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.