https://github.com/dcblogdev/laravel-api-starter
https://github.com/dcblogdev/laravel-api-starter
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcblogdev/laravel-api-starter
- Owner: dcblogdev
- Created: 2024-03-05T19:17:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T08:56:16.000Z (almost 2 years ago)
- Last Synced: 2025-04-08T11:18:23.785Z (10 months ago)
- Language: PHP
- Size: 80.1 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel API Starter
This is a starter project for Laravel API authentication.
It includes a user registration and login system.
There are tests for the registration and login.
## Installation
1. Clone the repository
2. Run `composer install`
3. Run `php artisan migrate`
4. Run `php artisan serve`
## Usage
### Registration
To register a user, send a POST request to `/api/register` with the following parameters:
- `name`
- `email`
- `password`
### Login
To login a user, send a POST request to `/api/login` with the following parameters:
- `email`
- `password`
The response will include a `token` which you can use to authenticate future requests.
### Logout
To logout a user, send a POST request to `/api/logout` include the `token` in the request headers.
After logging out, the token will no longer be valid.
### Authenticated Requests
To make an authenticated request, include the `token` in the request headers.
### Testing
To run the tests, run `php artisan test`
## License
This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).