2017-10-10 15:58:07 +01:00
|
|
|
<?php
|
|
|
|
|
2020-10-17 17:15:06 +01:00
|
|
|
namespace Database\Factories;
|
|
|
|
|
2017-12-22 14:28:41 +00:00
|
|
|
use App\Models\Bookmark;
|
2020-10-17 17:15:06 +01:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
|
2023-02-18 09:34:57 +00:00
|
|
|
/**
|
|
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Bookmark>
|
|
|
|
*/
|
2020-10-17 17:15:06 +01:00
|
|
|
class BookmarkFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = Bookmark::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
2023-02-18 09:34:57 +00:00
|
|
|
* @return array<string, mixed>
|
2020-10-17 17:15:06 +01:00
|
|
|
*/
|
2023-02-18 09:34:57 +00:00
|
|
|
public function definition(): array
|
2020-10-17 17:15:06 +01:00
|
|
|
{
|
|
|
|
$now = Carbon::now()->subDays(rand(5, 15));
|
|
|
|
|
|
|
|
return [
|
|
|
|
'url' => $this->faker->url,
|
|
|
|
'name' => $this->faker->sentence,
|
|
|
|
'content' => $this->faker->text,
|
|
|
|
'created_at' => $now->toDateTimeString(),
|
|
|
|
'updated_at' => $now->toDateTimeString(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|