Framework: Artisan -m options bug

Created on 28 Feb 2018  路  3Comments  路  Source: laravel/framework

  • Laravel Version: 5.6
  • PHP Version: 7.2.2
  • Database Driver & Version: MySQL 5.7

Description:

bug on artisan. you can't write = after -m options

Steps To Reproduce:

i tried to call that command
php artisan make:factory PostFactory -m=Post

and that create a file name PostFactory, that includes

<?php

use Faker\Generator as Faker;

$factory->define(App\=Post::class, function (Faker $faker) {
    return [
        //
    ];
});

the problem with the =

when i call that command
php artisan make:factory PostFactory -mPost

thats works fine

<?php

use Faker\Generator as Faker;

$factory->define(App\Post::class, function (Faker $faker) {
    return [
        //
    ];
});

`

Most helpful comment

when you use the shorthand, -m, you don't use the =. You use it when you use the full option.

php artisan make:factory --model=Post

All 3 comments

when you use the shorthand, -m, you don't use the =. You use it when you use the full option.

php artisan make:factory --model=Post

i know that, but why ? why one time i add = and another i don't.
i think it need to be the same, isn't ?

The entire point of the shorthand syntax is that it allows you to quickly use the defaults instead of having to explicitly define the setting.
If you don't want the defaults, don't use the short syntax.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments

JamborJan picture JamborJan  路  3Comments

ghost picture ghost  路  3Comments

Fuzzyma picture Fuzzyma  路  3Comments

felixsanz picture felixsanz  路  3Comments