jonnybarnes.uk/database/factories/NoteFactory.php
Jonny Barnes 630ec46186
chore: Update and clean up file imports and annotations
- 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
2023-07-28 12:05:11 +01:00

41 lines
835 B
PHP

<?php
namespace Database\Factories;
use App\Models\Note;
use Exception;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
/**
* @psalm-suppress UnusedClass
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Note>
*/
class NoteFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Note::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*
* @throws Exception
*/
public function definition(): array
{
$now = Carbon::now()->subDays(random_int(5, 15));
return [
'note' => $this->faker->paragraph,
'created_at' => $now,
'updated_at' => $now,
];
}
}