Initial project
This commit is contained in:
38
database/factories/MessageFactory.php
Normal file
38
database/factories/MessageFactory.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Conversation;
|
||||
use App\Models\Message;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Message>
|
||||
*/
|
||||
class MessageFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'conversation_id' => Conversation::factory(),
|
||||
'user_id' => User::factory(),
|
||||
'type' => Message::TypeText,
|
||||
'body' => fake()->randomElement([
|
||||
fake()->sentence(8),
|
||||
fake()->sentence(12),
|
||||
fake()->paragraph(2),
|
||||
'I pushed a cleaner version. Can you take a look?',
|
||||
'This is ready from my side.',
|
||||
'Let me know what you think about the latest update.',
|
||||
]),
|
||||
'metadata' => null,
|
||||
'edited_at' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user