nodes / api
Nodes wrapper for Dingo API
Installs: 6 363
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 4
Open Issues: 2
Requires
- nodes/cache: ~1.0
- nodes/core: ~1.1
- nodes/database: ~1.0
- nodes/dingo: ~2.0
- dev-master
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.17
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-develop
- dev-1-x
- dev-feature/nodes-formrequest-backend-compat
This package is not auto-updated.
Last update: 2022-02-01 12:54:37 UTC
README
⚠️This package is deprecated⚠️
Laravel support for REST apis are just fine now. Dingo API is not in beta anymore.
We suggest just using Laravel + spatie/laravel-fractal
A "mobile friendly" API package made on-top of the popular Dingo API package.
📝 Introduction
Before this package we used the awesome and popular Dingo API package, but as a company who create a lot of native iOS / Android apps, Dingo was lacking a few things here and there.
This package is in some way a more "mobile friendly" version of Dingo. It is build on-top of Dingo so all the goodies that Dingo comes with out-of-the-box is also available here.
We simply just added extra functionality and made it more flexible.
📦 Installation
To install this package you will need:
- Laravel 5.1+
- PHP 5.5.9+
You must then modify your composer.json
file and run composer update
to include the latest version of the package in your project.
"require": { "nodes/api": "^1.0" }
Or you can run the composer require command from your terminal.
composer require nodes/api:^1.0
🔧 Setup
Setup service providers in config/app.php
Nodes\Api\ServiceProvider::class,
Setup alias in config/app.php
'API' => Nodes\Api\Support\Facades\API::class, 'APIRoute' => Nodes\Api\Support\Facades\Route::class
Publish config files
php artisan vendor:publish --provider="Nodes\Api\ServiceProvider"
If you want to overwrite any existing config files use the --force
parameter
php artisan vendor:publish --provider="Nodes\Api\ServiceProvider" --force
Bypass Laravel's CSRF tokens
Laravel comes with a built-in CSRF token system, which is by default hooked into all POST
requests. This gives us a bit of a problem
since API requests won't contain the required CSRF token that Laravel expects. Therefore we need to whitelist all requests hitting our API.
This can be done by modifying the following file app/Http/Middleware/VerifyCsrfToken.php
and add api/*
to the $except
array:
protected $except = [ 'api/*', ];
⚙ Usage
Please refer to our extensive Wiki documentation for more infromation
🏆 Credits
This package is developed and maintained by the PHP team at Nodes
📄 License
This package is open-sourced software licensed under the MIT license