1
0
Fork 0

Adding Spell Model

This commit is contained in:
Henrik Hautakoski 2021-07-07 16:18:01 +02:00
parent b7ccc4a657
commit 78d5d8d50e
3 changed files with 102 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use App\Models\Spell;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Factories\Factory;
class SpellFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Spell::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'id' => $this->faker->unique()->randomNumber(5),
'name' => $this->faker->unique()->sentence(8),
'slug' => function (array $attributes) {
return Str::slug($attributes['name']);
}
];
}
}