Skip to content
Construindo e consumindo uma API RESTful no Laravel PHP
PHP HTML Vue
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bootstrap
config
database
public
resources
routes
storage
tests
.editorconfig
.env.example
.gitattributes
.gitignore
Building and Consuming a RESTful API in Laravel PHP - Twilio.pdf
artisan
composer.json
composer.lock
package.json
phpunit.xml
readme.md
server.php
webpack.mix.js
yarn.lock

readme.md

Construindo e consumindo uma API RESTful no Laravel PHP

building-and-consuming-a-restful-api-in-laravel-php

  • composer install
  • php artisan key:generate
  • php artisan migrate
  • php artisan serve

Prerequisites

  • PHP 7.1 or Higher
  • Composer
  • MySql
  • Laravel 5.6 or Higher (laravel/framework": "5.7.*)
  • Postman

API CRUD

GET /api/students GET /api/students/{id} POST /api/students PUT /api/students/{id} DELETE /api/students/{id}

Route::get('students', 'ApiController@getAllStudents');
Route::get('students/{id}', 'ApiController@getStudent');
Route::post('students, 'ApiController@createStudent');
Route::put('students/{id}', 'ApiController@updateStudent');
Route::delete('students/{id}','ApiController@deleteStudent');

Modelo de resultado

[
    {
        "id": 1,
        "name": "Michael Okoh",
        "course": "Computer Science",
        "created_at": "2019-02-08 14:11:17",
        "updated_at": "2019-02-08 14:11:17"
    }
]

Twitter: @cpdrenato

You can’t perform that action at this time.