Implements Task 2: creates the Site model with fillable name, url, and description fields; the corresponding database migration; and a factory for generating test data. Includes TDD tests verifying model creation with and without optional description. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
21 lines
405 B
PHP
21 lines
405 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Site;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class SiteFactory extends Factory
|
|
{
|
|
protected $model = Site::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => fake()->company(),
|
|
'url' => fake()->url(),
|
|
'description' => fake()->optional()->sentence(),
|
|
];
|
|
}
|
|
}
|