Files
todo_list/database/factories/UserFactory.php
rahmatrafli1 d62725c5af feat: add API routes for authentication and task management
- Created api.php for handling authentication routes (register, login, logout) with token middleware.
- Implemented task management routes using API resource controller.

feat: add console routes for artisan commands

- Added console.php to define an inspiring quote command.

feat: add web routes for homepage

- Created web.php to serve the welcome view at the root URL.

chore: add .gitignore files for storage directories

- Added .gitignore files in storage/app, storage/framework, and storage/logs to exclude unnecessary files from version control.

test: add feature and unit tests

- Created ExampleTest in Feature and Unit directories to verify basic application responses and assertions.

build: add Vite configuration for Laravel and Tailwind CSS

- Added vite.config.js to configure Vite with Laravel and Tailwind CSS for asset management.
2026-06-23 20:33:06 +07:00

46 lines
1.0 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends Factory<User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}