Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Eloquent\Factories;
4
 
5
trait HasFactory
6
{
7
    /**
8
     * Get a new factory instance for the model.
9
     *
10
     * @param  callable|array|int|null  $count
11
     * @param  callable|array  $state
12
     * @return \Illuminate\Database\Eloquent\Factories\Factory<static>
13
     */
14
    public static function factory($count = null, $state = [])
15
    {
16
        $factory = static::newFactory() ?: Factory::factoryForModel(get_called_class());
17
 
18
        return $factory
19
                    ->count(is_numeric($count) ? $count : null)
20
                    ->state(is_callable($count) || is_array($count) ? $count : $state);
21
    }
22
 
23
    /**
24
     * Create a new factory instance for the model.
25
     *
26
     * @return \Illuminate\Database\Eloquent\Factories\Factory<static>
27
     */
28
    protected static function newFactory()
29
    {
30
        //
31
    }
32
}