Questions tagged [dingo-api]

A RESTful API package for the Laravel framework.

197 questions
1
vote
1 answer

Remove key data in dingo - fractal

I already looked into several example on how to remove the key "data" in response, but i cannot fix it. I tried to use the callback provided by dingo return $this->collection($users, new UserTransformer, function ($resource, $fractal) { …
chkm8
  • 1,302
  • 1
  • 13
  • 34
1
vote
0 answers

Format dingo-api json response

Im using Dingo API with Laravel/Lumen. and so far im getting the correct HTTP responses and data. However I want to be able to format the way Dingo returns its JSON string to JSON_PRETTY_PRINT Currently its return JSON in the following…
user4258584
1
vote
0 answers

Add metadata to all Dingo API responses in Laravel

I am trying to add user-specific Metadata to every API response using Dingo Api. I assumede this would be done in an AddMetadata middleware:
Andrew Willis
  • 2,289
  • 3
  • 26
  • 53
1
vote
0 answers

Laravel Dingo API multiple versions when strict mode is false?

I dont know if this possible, but is possible to have multiple versions of Dingo API so for example: I can use: api.example.com/v1/request api.example.com/v2/request api.example.com/v3/request and still be able to search via the web browser…
Jorge Y. C. Rodriguez
  • 3,394
  • 5
  • 38
  • 61
1
vote
3 answers

Getting PUT data in Lumen

I'm struggling to create working PUT routes in my Lumen API. My requests reach the correct route, but I'm unable to access any values through $request->all(). I've figured out that PHP needs to read the php://input stream to get the PUT body. This…
Martijn
  • 73
  • 1
  • 6
1
vote
1 answer

Laravel JWT Auth error

I'm trying to implement JWT in Laravel 5.2 but I get this error: "message": "call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\\Auth\\TokenGuard' does not have a method 'once'", "status_code": 500, "debug": { …
Jamie
  • 10,302
  • 32
  • 103
  • 186
1
vote
2 answers

Using Laravel/Dingo for an API only

We have a large scale PHP appliction which is basically written in our own framework, from scratch. Now for mobile development we need to create an API, but the question is wether to use just a rest api package, or go for something more robust.…
Saif Bechan
  • 16,551
  • 23
  • 83
  • 125
1
vote
1 answer

How can I change the default error handler in Dingo/Api?

I am building a REST API using Laravel framework and the Dingo API library. Everything works well except that I don't know how I can customize the default error handler when exception happens. For example, when my code run error, the response is…
D0n9X1n
  • 2,114
  • 1
  • 14
  • 17
1
vote
1 answer

Lumen -> Error on line 54 - require(): Failed opening required

I install a fresh copy of Lumen as Heroku app. Also I implemented the packange Dingo into it: https://github.com/dingo/api/ but when I try to load everything server return me this error: 2016-02-14T11:07:45.657820+00:00 app[web.1]: [14-Feb-2016…
user3914418
1
vote
3 answers

Use laravel raw queries with dingo/APi + Fractal/transformers with laravel 5.1

I have an ArticleCommentsController with an index method class ArticleCommentsController extends BaseController { public function index($id) { $comments = DB::table('comments') ->leftJoin('users', 'users.id', '=',…
adetoola
  • 716
  • 1
  • 9
  • 19
1
vote
1 answer

Laravel - Dingo/Api - Request

I am just studying about laravel as api and I am using Dingo/Api to do it. I have a controller:
1
vote
2 answers

Laravel 5 dingo api, add multiple transformed objects to the response

Want to add a transformed object along with other response, I have used following code: $accessToken = Authorizer::issueAccessToken(); $user = User::where('email', $request->get('username'))->with('profile')->first(); if ($user) { …
mshakeel
  • 604
  • 6
  • 21
1
vote
2 answers

Get the prefix in Laravel 5.1 -Dingo/Api

I am using Laravel 5.1 and Dingo/Api. Is there a way to get the route prefix in it? I tried the getLastGroupPrefix() but it always returns null Here's my code BaseController : public function isAdminRequest() { return…
Bharat Geleda
  • 2,692
  • 1
  • 23
  • 31
1
vote
1 answer

Understanding API response from Laravel 5 Dingo/Api Using AngularJs; What's the correct JSON Format

I am building an API for a Laravel 5 Web application using AngularJs App as API consumer. Everything works perfectly except for the response returned from the API when a call is made from AngularJS. Here is what I have in AngularJs App which also…
Emeka Mbah
  • 16,745
  • 10
  • 77
  • 96
1
vote
1 answer

Route according to request method in Laravel Dingo?

I want to route requests according to request methods (GET, POST, PATCH, DELETE, PUT) how do I do this in dingo? I have tried this, but it isn't working. $api = app('Dingo\Api\Routing\Router'); $api->get('users', 'UserController@index', ['only' =>…
Nagendra Rao
  • 7,016
  • 5
  • 54
  • 92