Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HasFactory didn't include in Model when use the command make:model --all or -a #53383

Closed
OhmygoodR opened this issue Nov 2, 2024 · 2 comments · Fixed by #53391
Closed

HasFactory didn't include in Model when use the command make:model --all or -a #53383

OhmygoodR opened this issue Nov 2, 2024 · 2 comments · Fixed by #53391

Comments

@OhmygoodR
Copy link

OhmygoodR commented Nov 2, 2024

Laravel Version

11.x

PHP Version

8.3.4

Database Driver & Version

No response

Description

As #53104 discussed, it removes HasFactory if we are not generating a factory at all.

But HasFactory didn't include in Model when use the command make:model --all or -a

command

php artisan make:model Post -a

output

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    //
}

command

php artisan make:model Message --all

output

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    //
}

Steps To Reproduce

php artisan make:model Post -a

or

php artisan make:model Post --all
@adel007gh
Copy link
Contributor

Hello,

Thank you for bringing up this issue regarding the HasFactory trait not being included when using the php artisan make:model --all command. I wanted to let you know that I have addressed this issue in my pull request.

You can review the changes I've made to ensure that the HasFactory trait is included when generating models with the --all option.

Here is the link to the pull request: Fix for issue #53383.

Please check it out and let me know if you have any further feedback or questions!

Copy link

github-actions bot commented Nov 4, 2024

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants