A RESTful API package for the Laravel framework.
Questions tagged [dingo-api]
197 questions
16
votes
2 answers
Auth guard driver [api] is not defined. Lumen, Dingo, JWTAuth
I am trying to develop a rest api using lumen. For authentication I am using Dingo and JWTAuth api, but I am getting the following message:
Auth guard driver [api] is not defined.
Below is a screenshot of the message from Postman, including the…

sharif rahman
- 193
- 1
- 3
- 12
12
votes
3 answers
Dingo API remove "data" envelope
is it there an easy way to remove the "data" envelope from the Dingo API response.
When I use this Transformer to transform user models:
class UserTransformer extends EloquentModelTransformer
{
/**
* List of resources possible to include
…

Simon Schneider
- 1,216
- 1
- 15
- 23
11
votes
2 answers
Can I use transformers to transform data coming from API rather than from database?
I have been using laravel to build my APIs. I use transformers to tranform data from model object.
Now instead of database, I have a response coming from an API as the data source and I want to transform that data back to a user, but I am unable to…

Ajeesh
- 5,650
- 8
- 30
- 52
10
votes
1 answer
Laravel 5.4 OAuth with Dingo internal requests
I am using Laravel 5.4 with Dingo API, and I'm trying to get Laravel's OAuth 2.0 (Passport) to work with Internal Dingo requests. Previously, I was using JWT, but now I wish to use OAuth. This is my previous dispatcher code which passes along the…

Squiggs.
- 4,299
- 6
- 49
- 89
10
votes
1 answer
shows "message":"404 Not Found", while using dingo to create api in laravel 5.1
I have configure dingo package in laravel 5.1 but while I try to access
http://localhost:8000/test
it is showing following error
{"message":"404 Not…

santosh
- 381
- 2
- 12
10
votes
4 answers
Consistent REST API Response in Laravel+Dingo
I have been developing a set of rest APIs to be exposed for mobile apps. I am following the repository pattern for the development on the Laravel project. How do I implement a presenter and transformer for formatting a constant JSON output…

Ajeesh
- 5,650
- 8
- 30
- 52
9
votes
4 answers
Laravel multiple domain origin CORS
I want to allow two domains for CORS in my laravel to be able work with it locally and on the server, thus I don't wan't to expose my app to any domain. That is shat I have for now
public function handle($request, Closure $next)
{
return…

Sergey
- 7,184
- 13
- 42
- 85
8
votes
2 answers
Laravel 5.3 integrate dingo api and oauth2 Column not found: 1054 Unknown column 'api_token' in 'where clause'
I'm using laravel 5.3 to build api and backend management for mobile app.
I'm integrated Dingo/api package and use Oauth2 for authenticate.
I made an API and login with postman:
API url: mydomain/api/auth/login
Logged in result:
{
"meta": {
…

allready4v
- 163
- 1
- 3
- 8
8
votes
2 answers
Run Middleware Before Controller's Constructor On Laravel 5.1?
I have a middleware that authenticates a JWT user using tymon/jwt-auth package:
public function handle($request, \Closure $next)
{
if (! $token = $this->auth->setRequest($request)->getToken()) {
return $this->respond('tymon.jwt.absent',…

HTMHell
- 5,761
- 5
- 37
- 79
7
votes
2 answers
Laravel Dingo API and issues with Middleware\\VerifyCsrfToken.php
I use Dingo with Laravel 5.1 to create simple API.
So at route.php I have:
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function($api) {
$api->get('getvoucher', 'App\Http\Controllers\BitemsController@index');
…

Aleks Per
- 1,549
- 7
- 33
- 68
6
votes
2 answers
Laravel 5.4 - Cookie Queue
I'm using Laravel 5.4 and I wrote something like:
Cookie::queue(
'refresh_token',
$data->refresh_token,
864000, // 10 days
null,
null,
false,
true // HttpOnly
);
return…

Christian
- 685
- 1
- 5
- 13
5
votes
1 answer
Laravel & Dingo: Secure API with Facebook/Google Login
I have developed an API in Laravel with the Dingo Framework.
Now I want to secure API access with Facebook and/or Google Log-In (for example with OAuth)
Is there a tutorial or something like that? I don't know how to integrate the secure API access…

Daniel Pomrehn
- 791
- 3
- 8
- 23
5
votes
2 answers
JWT token with jQuery Ajax
I have an API being driven with Laravel, Dingo and JWT Tokens. Testing the API call with PAW works perfectly. Running the API calls with jQuery without middleware JWT Tokens disable works fine. But as soon as I try running an Ajax request with JWT…

Lee
- 20,034
- 23
- 75
- 102
5
votes
1 answer
Laravel 5 Dingo API controller
I have been trying to implement a REST API using the Laravel 5 Dingo API package.
This is my routing code:
$api->version('v1', function ($api) {
$api->get('users/{id}', 'Api\V1\UsersController@show');
});
This is my error…

sabin adhikari
- 225
- 3
- 14
4
votes
3 answers
Laravel hasMany save
I've two tables to save data to. One of them has foreign key so that I have one-to-many relationship. However, I don't understand how to save data into two table simultaneously. I have one query which contains data for one table and for another that…

Sergey
- 7,184
- 13
- 42
- 85