- Update various factory files in the `database/factories` directory - Remove unused imports and annotations in factory files - Add or update comments and PHPDoc blocks for better understanding and readability - Remove unused imports in controller and command files - Remove commented out code in middleware file
41 lines
1 KiB
PHP
41 lines
1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Like;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* @psalm-suppress UnusedClass
|
|
*
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Like>
|
|
*/
|
|
class LikeFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Like::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$now = Carbon::now()->subDays(rand(5, 15));
|
|
|
|
return [
|
|
'url' => $this->faker->url,
|
|
'author_name' => $this->faker->name,
|
|
'author_url' => $this->faker->url,
|
|
'content' => '<html><body><div class="h-entry"><div class="e-content">' . $this->faker->realtext() . '</div></div></body></html>',
|
|
'created_at' => $now->toDateTimeString(),
|
|
'updated_at' => $now->toDateTimeString(),
|
|
];
|
|
}
|
|
}
|