The Laravel Backend for CSS Dictionary is an API that brings together all the css properties, functions, effects and animations. Each collected code snippet has definition and examples for unique possible contexts.
"O Laravel Backend para dicionário CSS é uma API que reúne todas as propriedades, funções, efeitos e animações css. Cada trecho de código coletado possui definição e exemplos para singulares contextos possíveis.
Why (por que?) | Demo | How to use? (Como usar) | Overview (Visão geral) | About laravel | License
API: Application programming interface.
To learn how to create a web API with Laravel, with the basic functionalities of a CRUD (store, show, update and delete an element) for different css properties and their particular examples.
API: Interface de programação de aplicações.
Para aprender a criar uma API web com Laravel, com as funcionalidades básicas de um CRUD (armazenar, mostrar, atualizar e deletar um elemento) para diferentes propriedades css e seus particulares exemplos.
git clone https://github.com/rapha-developer/laravel-backend-for-css-dictionary.gitcd laravel-backend-for-css-dictionary
composer installphp artisan serve
The (Laravel Backend for CSS Dictionary) API root endpoint have only welcome's response for user. Please refer to the table below for the appropriate endpoint.
"A (Laravel Backend for CSS Dictionary) API endpoint raiz possui apenas uma resposta de boas vindas para o usuário. Por favor, consulte a tabela abaixo para obter o endpoint apropriado."
Route name | Method | Endpoint |
---|---|---|
API Root | GET |
/ |
GET {website}/https://rapha-developer-laravel.000webhostapp.com👉 Ou click here
All public requests to the API can be accessed by any user. Even without needing any authentication. (Please, refer to the table below for the proper link).
Todas as solicitações públicas para a API podem ser acessadas por qualquer usuário. Inclusive, sem precisar de qualquer autenticação. (Por favor, consulte a tabela abaixo para obter o endpoint apropriado).
Route name | Visibility | Method | Endpoint | Description |
---|---|---|---|---|
Register user | public |
POST |
/register |
Creates a user in database and generate a token for access protected routes. |
Login user | public |
POST |
/login |
Make login with the credentials {email, password} created by registered user |
POST {website}/registerhttps://rapha-developer-laravel.000webhostapp.com/registerAND
POST {website}/loginhttps://rapha-developer-laravel.000webhostapp.com/login
All protected requests to the API need an API token. Generate a token using public routes from API. (Please, refer to the table below for the proper link).
Todas as solicitações protegidas para a API precisam de um token de API. Gere um token usando rotas públicas da API. (Por favor, consulte a tabela abaixo para obter o endpoint apropriado).
Route name | Visibility | Method | Endpoint |
---|---|---|---|
Properties.index | protected |
GET |
/properties |
Properties.store | protected |
POST |
/properties |
Properties.show | protected |
GET |
/properties/:id |
Properties.update | protected |
PATCH |
/properties/:id |
Properties.delete | protected |
DELETE |
/properties/:id |
Route name | Visibility | Method | Endpoint |
---|---|---|---|
Samples.index | protected |
GET |
/samples |
Samples.store | protected |
POST |
/samples |
Samples.show | protected |
GET |
/samples/:id |
Samples.update | protected |
PATCH |
/samples/:id |
Samples.delete | protected |
DELETE |
/samples/:id |
Authorization: Bearer 4|ViZeL2NUDQ3o9mbNCQPpGy7q0ZrHAjc2TNHEUcex
👀 Not use this token above, it just example! 👀
make-request-from-api.mp4
Our REST API only supports JSON content for requests with a body and for responses. For each request containing a body with JSON, you will need to attach the header options below:
Nossa API REST suporta apenas conteúdo JSON para solicitações com um corpo e para respostas. Para cada requisição contendo corpo com JSON, você precisará anexar as opções de cabeçalho abaixo:
Header | Value |
---|---|
Accept |
application/json |
Content-Type |
application/json |
The (Laravel Backend for CSS Dictionary) API can return the following errors:
A (Laravel Backend for CSS Dictionary) API pode retornar os seguintes erros:
Status Code | Description | Solution |
---|---|---|
401 |
Unauthorized: User has no token or token is not more valid. | See Authentication. |
403 |
Forbidden: User not have authorization to make this request. | See Authentication. |
404 |
NOT FOUND. |
Register a new User
Name | Type | Status |
---|---|---|
name | string |
required |
email |
required |
|
password | string |
required |
password_confirmation | string |
required |
- If you use an email already registered, you will get
422
error.- If you have success, you will get
200
status code.
Login with the credentials of a registered user
Name | Type | Status |
---|---|---|
email |
required |
|
password | string |
required |
- if you enter the wrong email or password, you will get
401
error.- If you have success, you will get
200
status code.
Select all properties stored by current user
- if you enter with invalid token, you will get
401
error.- If you have success, you will get
200
status code.
Store a new property
Name | Type | Status |
---|---|---|
name | string |
required |
description | string |
required |
category | string |
required |
- if you enter with invalid token, you will get
401
error.- If you have success, you will get
201
status code.
Show single property by id
Name | Type | Status |
---|---|---|
id | integer |
required |
- if you enter with invalid property id, you will get
404
error (Not found exception).- If you have success, you will get
200
status code.
Update a property by id
Name | Type | Status |
---|---|---|
id | integer |
required |
Name | Type | Status |
---|---|---|
name | string |
optional |
description | string |
optional |
category | string |
optional |
- if you enter with invalid property id, you will get
404
error (Not found exception).- if you enter with property id from another user, you will get
403
error.- If you have success, you will get
200
status code.
Delete a property by id
Name | Type | Status |
---|---|---|
id | integer |
required |
- if you enter with invalid property id, you will get
404
error (Not found exception).- if you enter with property id from another user, you will get
403
error.- If you have success, you will get
200
status code.
Select all samples stored by current user
- if you enter with invalid token, you will get
401
error.- If you have success, you will get
200
status code.
Store a new Sample
Name | Type | Status |
---|---|---|
property_id | integer |
required |
title | string |
required |
description | string |
required |
description_pt | string |
required |
- if you enter with property id from another user, you will get
403
error.- If you have success, you will get
201
status code.
Show single sample by id
Name | Type | Status |
---|---|---|
id | integer |
required |
- if you enter with invalid sample id, you will get
404
error (Not found exception).- if you enter with id from another user, you will get
403
error.- If you have success, you will get
200
status code.
Update a sample by id
Name | Type | Status |
---|---|---|
id | integer |
required |
Name | Type | Status |
---|---|---|
property_id | integer |
optional |
title | string |
optional |
description | string |
optional |
description_pt | string |
optional |
- if you enter with invalid sample id, you will get
404
error (Not found exception).- if you enter with id from another user, you will get
403
error.- if you enter with property id from another user, you will get
403
error.- If you have success, you will get
200
status code.
Delete a sample by id
Name | Type | Status |
---|---|---|
id | integer |
required |
- if you enter with invalid sample id, you will get
404
error (Not found exception).- if you enter with sample id from another user, you will get
403
error.- If you have success, you will get
200
status code.
Laravel is a web application framework with expressive, elegant syntax. Laravel takes the pain out of development by easing common tasks used in many web projects.
Laravel é um framework de aplicações web com sintaxe expressiva e elegante. O Laravel facilita o desenvolvimento facilitando tarefas comuns usadas em muitos projetos da web.
The Laravel framework is open-sourced software licensed under the MIT license.