Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel set custom factory

 // If you factory is out of standard, you can set an specifc
    // On your model, create a static method named newFactory

    protected static function newFactory()
    {
        return DatabaseFactoriesMyModelFactory::new();
    }

    //On your factory, add this
    protected $model = AppModelsMyModel::class;
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #laravel #set #custom #factory
ADD COMMENT
Topic
Name
7+3 =