Questions tagged [dingo-api]

A RESTful API package for the Laravel framework.

197 questions
0
votes
0 answers

How to use paginator of Dingo API in Laravel?

I use $this->response->paginator($school, new SchoolTransformer()); to transform my data but the result is not good. { "0": { "id": 35, "name": "北京东城大学", "icon_url": "http://www.dicki.info/", "area": "北京市 东城区", "status": 1, "count_users":…
叶峰瑞
  • 1
  • 1
0
votes
0 answers

Dingo with Laravel doesn't show errors

I've got a problem with Dingo and Laravel 5.4, I'm getting HTTP 500 Internal Error without any other details (blank chrome/postman page) even if I got in config/app.php: 'debug' => true, 'env' => 'local', and in config/api.php: 'debug' =>…
ketysek
  • 1,159
  • 1
  • 16
  • 46
0
votes
1 answer

Laravel 5.4 upgrade broke API Dingo tests

I use Laravel 5.3 with Dingo to manage the API requests. I am trying to upgrade to Laravel 5.4 but my tests are failing. Here is a case: $request = $this->get('/api/authenticated-user', $this->headers()); $limit =…
fred00
  • 571
  • 2
  • 8
  • 23
0
votes
1 answer

Laravel 5.2 - method DELETE not allowed (error 405)

I have a database with two tables: table CATEGORIES has an id that is the fk of table PRODUCTS. When I want to delete a category, and a record in table products has associated that category id, laravel return a 405 error and i cannot access to…
Matteo Meil
  • 1,192
  • 10
  • 20
0
votes
0 answers

Two different rules on Post method with FormRequest in Laravel

I use Dingo API and FormRequest to validate HTTP API requests. I have those rules: switch ($this->method()) { case 'POST': return [ 'file' => 'required|mimes:pdf,png,jpeg,jpg', 'title' =>…
Tasos
  • 7,325
  • 18
  • 83
  • 176
0
votes
1 answer

Middleware for "guest" type user, using Dingo API

My User model may be anonymous (eg. no e-mail registered, $user->isAnonymous()). By using the api.auth middleware both anonymous and fully registered users can access a given route. Now I want to restrict a route, so that anonymous users can not…
Zoon
  • 1,068
  • 2
  • 11
  • 26
0
votes
3 answers

How to organise controllers for REST relationships? [Laravel routes]

Imagine entities Genre and Book. Each have API resource endpoints /genre and /book. In Laravel routes that might be: $app->resource('/genre', GenreController::class); I want an endpoint for the relationship. GET /genre/1/book, to get books under…
Zoon
  • 1,068
  • 2
  • 11
  • 26
0
votes
1 answer

Different error message if I include an exception in Request rules

I have the following update function for my model: public function update(PartnerRequest $request, $id) { $partner = Partner::findOrFail($id); if(!$partner -> update($request->all())) { throw new HttpException(500); } …
Tasos
  • 7,325
  • 18
  • 83
  • 176
0
votes
2 answers

Laravel : Dingo/API Pagination custom root key

I've developed an API with Laravel 5 and Dingo/API. Following the documentation, i used pagination and my code look like that $users = User::paginate(50); return $this->response->paginator($users, new UserTransformer); Unfortunately, the response…
makz
  • 51
  • 9
0
votes
1 answer

Laravel Dingo Authentication JWT Required on Internal Requests

I'm using Laravel Dingo to consume API requests (internally) within Laravel controllers, and have come up against a problem with routes which are authenticated with tokens in headers. I'm getting an Exception thrown, looking for a token in…
Squiggs.
  • 4,299
  • 6
  • 49
  • 89
0
votes
2 answers

JWT Auth config on Dingo Api Laravel 5.1.*

I am using Laravel 5.1.33 with Dingo Api and JWT Auth, have installed all of these but now I am confused if I need to do more if I for example want to authenticate a user so the user is not able to access certain routes without being logged in…
Lulzim Fazlija
  • 865
  • 2
  • 16
  • 37
0
votes
1 answer

Laravel: Understanding which api framework to choose

Our company is about to start a real estate project and have decided to go with the laravel 5.3 framework. The first phase is to write the apis and then these apis will be consumed by the mobile team and the frontend team to build the official…
Phantom007
  • 2,079
  • 4
  • 25
  • 37
0
votes
1 answer

Laravel: Dingo API - NGINX 404 all routes

sorry if this a double post but I can't find the problem with this I installed Dingo api on a server with NGINX, PHP5.6 but everytime I access the server routes(e.g.http://104.27.5.XXX/api/brands) I always get Here is the routes: $api =…
Drew
  • 710
  • 1
  • 15
  • 34
0
votes
1 answer

How to authenticate user with token (stay authenticated in iPhone)

I have two related questions and I hope someone help me because I've been stuck for 2 days First: mobile phone failed to authenticate Here is what I have done: 1- user signs up 2- token released 3- token saved in user's device but then when the…
AlmoDev
  • 969
  • 2
  • 18
  • 46
0
votes
2 answers

Setting up Laravel's OAuth 2.0 is Dingo API

I use Laravel 5.3 with Dingo API, and I'm trying to get Laravel's OAuth 2.0 (aka Passport) to work with Dingo's Authentication. I added the OAuth 2.0 provider in config/api.php, which I found here: 'auth' => [ 'oauth' => function($app) { …
OverCoder
  • 1,472
  • 23
  • 33