This commit is contained in:
Enoch
2024-08-09 22:16:39 +08:00
commit d78b38e80f
3984 changed files with 416946 additions and 0 deletions
@@ -0,0 +1,32 @@
<?php
namespace Illuminate\Database\Eloquent\Factories;
trait HasFactory
{
/**
* Get a new factory instance for the model.
*
* @param callable|array|int|null $count
* @param callable|array $state
* @return \Illuminate\Database\Eloquent\Factories\Factory<static>
*/
public static function factory($count = null, $state = [])
{
$factory = static::newFactory() ?: Factory::factoryForModel(get_called_class());
return $factory
->count(is_numeric($count) ? $count : null)
->state(is_callable($count) || is_array($count) ? $count : $state);
}
/**
* Create a new factory instance for the model.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory<static>
*/
protected static function newFactory()
{
//
}
}