我想在使用工厂时在播种机中定义工厂中的覆盖属性。
例如,在 Laravel 7 中,可以将它们作为第三个参数
$factory->define(Menu::class, function (Faker $faker, $params) {
/* here params have the override attributes, which can be used to specify other attributes based on it's value, for example menu_type */
}
现在升级到 laravel 8 时,是否有办法在定义方法中获取这些属性?
任何想法都会有所帮助。谢谢!