This sample demonstrates Laravel RESTful API. Demonstration of REST Api functions with creating functional test that use the REST Layer directly.
Please consult doc/spec.pdf for API specification.
- User roles (producer, customer)
- Article CRUD
- Token api auth system
- Article grading system
- Article extension
- Unit tests
- Expired ads deletion (Cron/Laravel Scheduler)
- Full OAuth2 support
- Ad view counter
Note: Current set up uses PHPUnit tests and in-memory SQLite database for performant runs.
When running the API revert to permanent database and adjust database settings accordingly.
Add the following Cron entry to your server, to start a scheduler
crontab -e
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
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:
composer install
php artisan migrate
php artisan db:seed
php artisan serve
The API will be running on localhost:8000
.