Laravel based technical test
Endpoint | Description | Sample |
---|---|---|
/api/v1/auth/login | User login with user/password. Returns a token (sanctum) | |
/ api/v1/auth/register | Register a user account | |
/api/v1/users/me | Get user account. Expects a bearer token |
Sample body /api/v1/auth/register
{
"name":"Jane Doe",
"password":"password@1234",
"password_confirmation":"password@1234",
"email":"[email protected]",
"phone_number":"254712345678"
}
Sample body /api/v1/auth/login
{
"password":"password@1234",
"email":"[email protected]"
}
- PHP 7.4+
- Mysql database
- Composer
- Install project php dependencies with composer
composer install
- Create a database and update the credentials in .env file
- Run migrations
php artisan migrate
- Seed the database table with some users
php artisan db:seed
- Publish docker-compose
php artisan sail:install
- Start the application
./vendor/bin/sail up