Implement SocialAccount model with enum fields for network and type, along with migration and factory. Includes NETWORKS and TYPES constants for dropdown usage in Livewire forms and validation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
23 lines
582 B
PHP
23 lines
582 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\SocialAccount;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class SocialAccountFactory extends Factory
|
|
{
|
|
protected $model = SocialAccount::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'network' => fake()->randomElement(SocialAccount::NETWORKS),
|
|
'username' => fake()->userName(),
|
|
'email' => fake()->safeEmail(),
|
|
'password' => fake()->password(),
|
|
'type' => fake()->optional()->randomElement(SocialAccount::TYPES),
|
|
];
|
|
}
|
|
}
|