Implemented the authenticated admin contact system.
This commit is contained in:
30
database/factories/SupportAttachmentFactory.php
Normal file
30
database/factories/SupportAttachmentFactory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SupportAttachment;
|
||||
use App\Models\SupportMessage;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SupportAttachment>
|
||||
*/
|
||||
class SupportAttachmentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'support_message_id' => SupportMessage::factory(),
|
||||
'disk' => 'local',
|
||||
'path' => 'support/testing/debug.log',
|
||||
'original_name' => 'debug.log',
|
||||
'mime_type' => 'text/plain',
|
||||
'size' => 128,
|
||||
];
|
||||
}
|
||||
}
|
||||
29
database/factories/SupportConversationFactory.php
Normal file
29
database/factories/SupportConversationFactory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SupportConversation;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SupportConversation>
|
||||
*/
|
||||
class SupportConversationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'category' => fake()->randomElement(SupportConversation::categories()),
|
||||
'subject' => fake()->sentence(4),
|
||||
'status' => SupportConversation::STATUS_OPEN,
|
||||
'last_message_at' => now(),
|
||||
];
|
||||
}
|
||||
}
|
||||
28
database/factories/SupportMessageFactory.php
Normal file
28
database/factories/SupportMessageFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SupportConversation;
|
||||
use App\Models\SupportMessage;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SupportMessage>
|
||||
*/
|
||||
class SupportMessageFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'support_conversation_id' => SupportConversation::factory(),
|
||||
'user_id' => User::factory(),
|
||||
'body' => fake()->paragraph(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user