Archived
1
0
Fork 0

Initial Commit

This commit is contained in:
Henrik Hautakoski 2021-10-18 11:53:33 +02:00
commit ddf09fe00c
113 changed files with 187148 additions and 0 deletions

View file

@ -0,0 +1,40 @@
<?php
namespace Database\Factories;
use App\Models\Card;
use App\Models\Character as Model;
use Illuminate\Database\Eloquent\Factories\Factory;
class CharacterFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Model::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->firstName(),
];
}
public function cards($count)
{
$cards = Card::factory()
->count($count)
->state(function (array $attr) {
return ['class' => null ];
});
return $this->has($cards);
}
}