A RESTful API package for the Laravel framework.
Questions tagged [dingo-api]
197 questions
2
votes
3 answers
Lumen with Dingo API routes not defined
Have a fresh install of Lumen 5.2 and new install of Dingo 1.0.*@dev
I have installed the service provided in bootstrap/app.php
Also setup .env file eg
API_VERSION=v1
API_PREFIX=api
API_SUBTYPE=app
API_DEBUG=true
In the Http/routes.php I have added…

Lee
- 20,034
- 23
- 75
- 102
2
votes
1 answer
Laravel 5.2 Dingo/api resources group
As the title mentions, I am trying to figure out how to make a resource group by dingo.
As it explains with laravel, the correct way to make a resource group in route is:
Route::resource('item', 'Api\ItemController');
is it similar with the…

Hoffie
- 325
- 2
- 14
2
votes
2 answers
Nested Transformation with Fractal, Dingo API, Laravel 5
I'm trying to transform a collection of tickets with the following code
public function transform(Ticket $ticket) {
return [
'id' => $ticket->id,
'title' => $ticket->title,
'status' =>…

Marco Aurélio Deleu
- 4,279
- 4
- 35
- 63
2
votes
1 answer
Client authentication failed when trying to get oAuth access token
I'm working on a Laravel 4.2 app built with dingo/api and NeoEloquent to support Graph databases. I want to implement OAuth, probably using lucadegasperi/oauth2-server-laravel, but this doesn't work with NeoEloquent. After I created a Client in the…

gidomanders
- 465
- 5
- 16
2
votes
1 answer
No query results for model in Laravel with Dingo - how to make a RESTful response on failure?
I'm creating an API with Laravel based on the Dingo API.
In my routes, I have:
Route::api('v1', function () {
Route::resource('object', 'My\Namespace\MyController');
});
And in MyController:
class MyController extends…
user1544337
1
vote
1 answer
Trying to get property 'hostname' of non-object
When I use php artisan api:routes I receive the following error:
Trying to get property 'hostname_id' of non-object
I have the following code where is this error :
protected $user;
protected $hostname_id;
public function __construct() {
…

Mindru Ion
- 373
- 5
- 19
1
vote
0 answers
Dingo Api throttling based on User
I wanted to limit the API request specific to user in Laravel Application.
I tried to following code to create custom throttle mentioned in https://github.com/dingo/api/wiki/Rate-Limiting#custom-throttles
use Illuminate\Container\Container;
use…

Sujit Baniya
- 895
- 9
- 27
1
vote
1 answer
Laravel validate array of objects issue
I have a request in which I pass an array of JSON objects. It has the following structure
[ {path: 'string', class: 'string'} ]
As far as I understand there is no easy way to check this array so I've tried next
$validatedData =…

Sergey
- 7,184
- 13
- 42
- 85
1
vote
3 answers
Laravel hasMany error. 'site_id' doesn't have a default value
I have following method in a controller
public function store(Request $request)
{
$site = Site::create([
"path" => $request->path,
"site_link" => $request->link,
]);
if ($request->features) {
$features =…

Sergey
- 7,184
- 13
- 42
- 85
1
vote
1 answer
Dingo Api registering in RouteServiceProvider
I've read that it's possible to specify namespace for Dingo in that way
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', ['namespace' => 'App\Http\Controllers'], function ($api) {
$api->get('sites', 'SiteController@index');
…

Sergey
- 7,184
- 13
- 42
- 85
1
vote
1 answer
How can I edit dingo/api auth middleware in Laravel?
In a fully restful Laravel project, I'm using dingo/api package. I need to set some configs and other stuff related to current user, before any request get handled. When we using dingo, we can access the current user like this:
$user =…

Amir
- 413
- 4
- 13
1
vote
2 answers
Empty string validates for not required integer
I have to validate an input field of my API where the value has to be an integer between 1 and 100 or null or it is not even set (not required).
Thereby, my validation rule is: 'privacy_status' => "nullable|integer|min:1|max:100",
This works fine…

braun_lukas
- 53
- 1
- 11
1
vote
3 answers
Laravel : API response with pagination parameter
I want to pass pagination parameters through POSTMAN and pass sort,order,limits in my model to get query with paginate.? how can i do this? Currently it return error.
Currently my route :
http://localhost:8000/api/allpost
My PostController function…

Javed
- 817
- 4
- 22
- 44
1
vote
1 answer
I use dingo/api in laravel.But it's always error 404
I use dingo/api in laravel.But it's always error 404.
This is my config file:
# dingo/api`
API_STANDARDS_TREE=vnd
API_SUBTYPE=ipr
API_PREFIX=api
API_VERSION=v1
API_DEBUG=true
And ,in my config/app.php
enter image description…

Capping Zhang
- 15
- 6
1
vote
0 answers
Rate Limiting does not work in dingo laravel
According to this guidance ,I added a throttle functionality to a specific route in my laravel project like this :
$api->group(['prefix' => 'auth'], function ($api) {
$api->post('checkUser', ['middleware' => 'api.throttle', 'limit' => 3,…

Ahmad Badpey
- 6,348
- 16
- 93
- 159