Skip to content
Advertisement

Tag: factory

How does a Laravel factory gets the $factory variable defined?

A new factory in laravel looks like this; The variabele $factory does’nt get defined in this file. How and where does this variabele get defined? A dd($factory) results as expected in an IlluminateDatabaseEloquentFactory object Answer The variable $factory is not defined in the file itself. Only when this file is processed by Laravel, by including it during the loading process,

Advertisement