The Api created with Laravel from contacts SPA (visit here)
- PHP ^7.3|^8.0
- mbstring PHP Extension
- PDO Extension
$ git clone https://github.com/flavianohonorato/api_contacts
Do not forget to configure your database and the like in the .env configuration file. After doing this, run the following command within your installation directory:
$ composer install
$ php artisan migrate
$ php artisan db:seed
$ php artisan serve
- To list all contacts (with pagination)
GET /api/v1/contacts?page=1 HTTP/1.1
Host: localhost:8000
- To add a contact
POST /api/v1/contacts HTTP/1.1
Content-Type: application/json
Host: localhost:8000
{
"name": "jane Doe",
"email": "jane@doe.com.br",
"cpf": "000-111.222-33"
}
- To update a contact
PUT /api/v1/contacts/1 HTTP/1.1
Content-Type: application/json
Host: localhost:8000
{
"name": "Jane Doe"
}
- To show a contact
GET /api/v1/contacts/1 HTTP/1.1
Host: localhost:8000
- To delete a contact
DELETE /api/v1/contacts/1 HTTP/1.1
Content-Type: application/json
Host: localhost:8000
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.