https://github.com/andrecastelo/example-api
Very simple API using Laravel
https://github.com/andrecastelo/example-api
laravel php
Last synced: 12 months ago
JSON representation
Very simple API using Laravel
- Host: GitHub
- URL: https://github.com/andrecastelo/example-api
- Owner: andrecastelo
- Created: 2017-03-31T03:29:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T11:04:56.000Z (almost 8 years ago)
- Last Synced: 2024-11-06T13:00:09.639Z (over 1 year ago)
- Topics: laravel, php
- Language: PHP
- Homepage:
- Size: 226 KB
- Stars: 134
- Watchers: 11
- Forks: 77
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Example Laravel API
This is a sample project to show how you could write an API using Laravel 5. You can follow the tutorial online at https://www.toptal.com/laravel/restful-laravel-api-tutorial
There will be some minor differences, specially regarding downloaded packages, as I used the
excellent [Laravel Ide Helper](https://github.com/barryvdh/laravel-ide-helper) to setup
PhpStorm bindings and other features.
## Running the API
It's very simple to get the API up and running. First, create the database (and database
user if necessary) and add them to the `.env` file.
```
DB_DATABASE=your_db_name
DB_USERNAME=your_db_user
DB_PASSWORD=your_password
```
Then install, migrate, seed, all that jazz:
1. `composer install`
2. `php artisan migrate`
3. `php artisan db:seed`
4. `php artisan serve`
The API will be running on `localhost:8000`.