mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 00:21:08 +03:30
feat: add factory for models
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Message>
|
||||
*/
|
||||
class MessageFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'title' => $this->faker->word,
|
||||
'text' => $this->faker->word,
|
||||
'sender_user_id' => User::factory(),
|
||||
'recipient_user_id' => User::factory(),
|
||||
'status' => $this->faker->randomElement(['Read', 'UnRead']),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user