bug on artisan. you can't write = after -m options
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 [
//
];
});
`
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.
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