Add GroupFactory

This commit is contained in:
philipp lang 2021-06-13 11:27:22 +02:00
parent 8043911992
commit 5388ba71ff
2 changed files with 32 additions and 0 deletions
app
database/factories

View File

@ -3,9 +3,12 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Group extends Model
{
use HasFactory;
public $fillable = ['name', 'nami_id'];
public $timestamps = false;

View File

@ -0,0 +1,29 @@
<?php
namespace Database\Factories;
use App\Group;
use Illuminate\Database\Eloquent\Factories\Factory;
class GroupFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Group::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->randomElement(['Normaler Beitrag', 'Familienermäßigt']),
'nami_id' => $this->faker->randomNumber(),
];
}
}