Skip to content

Add create:factory command#1209

Merged
LukeTowers merged 3 commits intowintercms:developfrom
sephyld:add-make-factory-command
Oct 3, 2024
Merged

Add create:factory command#1209
LukeTowers merged 3 commits intowintercms:developfrom
sephyld:add-make-factory-command

Conversation

@sephyld
Copy link
Contributor

@sephyld sephyld commented Sep 22, 2024

also added --F|factory option to make:model for factory creation


Implements feature request #1007


Hello everyone, I'd love a review of this PR. My main concern is that I'm not using a Winter-specific Factory class to inherit from in the factory.stub, but the created Factory inherits directly from the Laravel base factory class.

// Created Factory Class PostFactory.php
//[...]
use Illuminate\Database\Eloquent\Factories\Factory;

class PostFactory extends Factory
//[...]

Unlike the related model, which inherits from the Winter Model class

// Created Model Class Post.php
//[...]
use Winter\Storm\Database\Model;

/**
 * Post Model
 */
class Post extends Model
{

I don't think this is inherently an issue, but in the case it is, I think I'll have to add a Factory base class in the Storm library

also added `--F|factory` option to make:model for factory creation
stub phpdocs indentation fix
@LukeTowers LukeTowers added enhancement PRs that implement a new feature or substantial change needs response Issues/PRs where a maintainer is awaiting a response from the submitter labels Sep 24, 2024
@LukeTowers LukeTowers added Status: Completed and removed needs response Issues/PRs where a maintainer is awaiting a response from the submitter labels Oct 3, 2024
@LukeTowers LukeTowers added this to the 1.2.7 milestone Oct 3, 2024
@LukeTowers LukeTowers changed the title Add make factory command Add create:factory command Oct 3, 2024
@LukeTowers LukeTowers merged commit 1a3b477 into wintercms:develop Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants