Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel model factory attribute

 // 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 #model #factory #attribute
ADD COMMENT
Topic
Name
1+1 =