A RESTful API package for the Laravel framework.
Questions tagged [dingo-api]
197 questions
4
votes
1 answer
Request to API works in Postman but not when I try with laravel/guzzle
I make an API and now I try to access to that API.
WIth Postman everything is perfect and works fine:
but when I try the same with guzzle/laravel with code:
$res3 = $client3->post('https://app.EXAMPLE.com/api/update/'.$serial, [
'headers' => [
…

Aleks Per
- 1,549
- 7
- 33
- 68
4
votes
1 answer
Fracture Transform throws boolean given
I am using a Transformer in my Laravel project. When I don't include an other object in the Transformer there isn't any problem but when I include the Customer object I get the following error:
Argument 1 passed to…

Bart Bergmans
- 4,061
- 3
- 28
- 56
4
votes
1 answer
How to integrate role based permission in Laravel with Dingo API?
I'm currently studying Laravel framework and dingo api. Is there any way to integrate the role based permission using entrust to dingo api?
So for example, I have a route to get all the list of users, but only admin can access this.
So if the user…

A Mendoza
- 101
- 2
- 10
4
votes
2 answers
Dingo API - How to add version number in url?
I have just installed Dingo and it appear to work with the following URL:
http://website.dev/api/test
http://website.dev/api/hello
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->get('test', function…

I'll-Be-Back
- 10,530
- 37
- 110
- 213
4
votes
3 answers
Eloquent model attributes as camel case [Laravel 5.2] [Dingo API]
Our Eloquent models have attributes following the Laravel snake case convention.
e.g. first_name, last_name and created_at
Although my frontend (react) follows the javascript camel case standard.
e.g. firstName, lastName and createdAt
Is there a…

AndrewMcLagan
- 13,459
- 23
- 91
- 158
4
votes
1 answer
Laravel 5 API with Dingo
I'm building an API using Laravel 5 and Dingo. How do I catch any requests which do not have a route defined? I want my API to always respond with a specifically formatted JSON response.
So for example if I have a route:
$api->get(…

Joel Leger
- 349
- 4
- 11
4
votes
4 answers
CSRF with REST API laravel
I am new in laravel. I want to create REST API's with Laravel, I have used Dingo for it.
Now my problem is when I am sending post request
CSRF token mismatch is error is throwing
and for web version we have used CSRF token for validating the…

Vikas Kad
- 1,013
- 1
- 18
- 38
4
votes
1 answer
Getting error trying to get authenticated user
Using dingo/api along with lucadegasperi/oauth2-server-laravel. Authenticating a user is fine and I get an access token back but any time I make another request I get the following error:
call_user_func() expects parameter 1 to be a valid callback,…

Johnathan Barrett
- 546
- 2
- 7
- 24
4
votes
1 answer
Laravel route works perfectly locally but not on remote. (Dingo Api)
I am using dingo/api for a project and all of my routes work other than 1.
routes.php
$api = app('api.router');
$api->version('v1',['prefix' => 'api'], function ($api) {
$api->post('users',…

Bharat Geleda
- 2,692
- 1
- 23
- 31
4
votes
1 answer
phpunit and http content-type
I have an API built in Laravel (Dingo) and it works perfectly. However I have a problem with implementing phpunit to unit test my API
class ProductControllerTest extends TestCase
{
public function testInsertProductCase()
{
$data =…

Don Djoe
- 705
- 1
- 10
- 21
3
votes
0 answers
Generic custom error response in Dingo API
I am trying to abstract all my error responses to match my API documentation for developing a good, pragmatic API using Lumen and the Dingo API package:
A JSON error body should provide a few things for the developer - a useful error message, a…

Verhelst
- 1,492
- 2
- 22
- 46
3
votes
1 answer
Facebook and JWT Auth w/ Laravel back-end and React Native app
I have built a website with vuejs front-end and laravel back-end.
Only way to login is via Facebook Login using Socialite
All that works fine.
Now I am building some React Native apps (Ios/Android) that also use Facebook login but need to interact…

vesperknight
- 720
- 9
- 17
3
votes
1 answer
Call to undefined method Illuminate\Routing\Route::getUri()
I am trying to make rest api with dingo for laravel 5.3 . I have setup dingo on my project and created a api route like this for test .
$api->version('v1', function ($api) {
$api->get('hello',function (){
return "hello";
…

arif hasnat
- 171
- 4
- 11
3
votes
0 answers
How to override a vendor class in Laravel 5?
I can't seem to get this specific class overridden.
In RouteServiceProviders boot() function I have this line:
$this->app->bind('Dingo\Api\Routing\Route', 'App\Extensions\Vendor\Dingo\Api\Routing\Route');
I'm trying to override the Dingo Route…

Warz
- 333
- 3
- 11
3
votes
1 answer
Lumen + Dingo + JWT is not instantiable while building
I am trying to get a basic working foundation for a Lumen + Dingo Rest API, but I am not able to figure out how to peace is all together.
Lumen is working fine, but when I try to add Dingo I get all sorts of errors. From the Dingo documentation I…

Saif Bechan
- 16,551
- 23
- 83
- 125