C:\xamp\htdocs\XpenseSplites>composer require dingo/api:0.9.x@dev
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for dingo/api 0.9.x@dev -> satisfiable by dingo/api[v0.9.0].
- Conclusion: remove laravel/framework v5.2.37
- Conclusion: don't install laravel/framework v5.2.37
- dingo/api v0.9.0 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[5.1.x-dev, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.6, v5.1.8].
- don't install illuminate/support 5.1.x-dev|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.1|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.13|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.16|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.2|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.20|don't install laravel/framework v5.2.37
- Conclusion: don't install laravel/framework v5.2.37
- dingo/api v0.9.0 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[5.1.x-dev, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5
.1.30, v5.1.31, v5.1.6, v5.1.8].
- don't install illuminate/support 5.1.x-dev|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.1|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.13|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.16|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.2|don't install laravel/framework v5.2.37
- don't install illuminate/support v5.1.20|don't install laravel/framework v5.2.37
Installation failed, reverting ./composer.json to its original content.
i also try this
composer require dingo/api:0.10.x@dev
composer require dingo/api:1.0.x@dev
give "minimum-stability": "dev", in composer.json
my php version is 5.6.21.0 and laravel's version is 5.2.37
I ran into the same issue, @Virendra-Varma. It has to do with the dependency version requirements of both dingo/api and dingo/blueprint. I actually forked both of these repos in order to continue using Dingo with the modern Laravel release. If you are interested, I plan to maintain my forks until Dingo releases a stable version. You can view it here, and using it is this simple:
composer require drmyersii/dingo-api:v1.0.*
Good luck!
I am experiencing the same issue with Laravel 5.2.38 and with Dingo composer require dingo/api:1.0.x@dev.

After trying your suggestion i got this
Actually i am new in laravel and now feeling frustrated.
@drmyersii thanks for response bro. after simple update problem is solved...
@Virendra-Varma glad to hear you got it working! I forgot to mention that you might need to update your composer.lock file. Thanks!
@drmyersii Hi, thanks for the hotfix. With the latest version from your fork the docs generator is not working:
Exception:
#0 /../api/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php(60): Webmozart\Assert\Assert::string(Object(ReflectionClass))
#1 /../api/vendor/drmyersii/dingo-blueprint/src/Resource.php(144): phpDocumentor\Reflection\DocBlock->__construct(Object(ReflectionClass))
#2 /../api/vendor/drmyersii/dingo-blueprint/src/Blueprint.php(145): Dingo\Blueprint\Resource->getDescription()
#3 /../api/vendor/laravel/framework/src/Illuminate/Support/Collection.php(146): Dingo\Blueprint\Blueprint->Dingo\Blueprint\{closure}(Object(Dingo\Blueprint\Resource), 'App\\Api\\Control...')
Controller
/**
* Class TokenController
*
* @Resource("Auth", uri="/auth")
* @package App\Api\Controllers\v1\Auth
*/
class TokenController extends Controller
{
/**
* Returns the access token
*
* @Post("/access_token")
* @return \Illuminate\Http\JsonResponse
*/
public function access()
{
return Response::json(Authorizer::issueAccessToken());
}
/**
* Rogets the user and the access token
*/
public function forget()
{
}
}
@pionl I'll take a look at this later tonight. I figured I might get some issues with the Docs generator. I just wanted to at least get the API package working. Thanks for the help!
@pionl can you give me a little more information regarding your issue (PHP version, Laravel version, OS, etc.)? I'm having trouble recreating it. Thanks!
@drmyersii Sure
Using:
The problem is that the $summary object in the DocBlock has Reflection Class, but expects the string, the function getDescription creates the new block with reflector instance (\Dingo\Blueprint\Resource.php).
public function getDescription()
{
return (new DocBlock($this->reflector))->getText();
}
The actions/annotations looks parser in the correct way, also the method getText is not any more implemented in the DocBlock. It seems that the version 3 has changed the API.
I actually just figured it out shortly before you replied! Thanks for the help on this! If you just run composer update, you should get the latest version of drmyersii/dingo-blueprint. Please let me know as soon as you test it to confirm it is working as expected. Thanks!
Edit: Forgot to tag you, @pionl!
@drmyersii Works like a magic 馃憤 thank you. Currently not sure if there is problem in my syntax, but the docs doesn't support multiple request (via identifier) and responses. in docs there is mention that the request could work in multiple ways. Is it supported? :)
/**
* Authorizes user in auth with the providers grant type (facebook or google).
*
* For google you must authorize:
* - userinfo.email
* - userinfo.profile
*
* For Facebook you need to authorze:
* - email
* - public_profile
*
* @Post("/external")
* @Versions({"v1"})
* @Request(
* "grant_type=facebook&client_secret=x&client_id=x&access_token=token_from_external_provider",
* contentType="application/x-www-form-urlencoded", identifier="Facebook"
* )
* @Request(
* "grant_type=google&client_secret=x&client_id=x&access_token=token_from_external_provider",
* contentType="application/x-www-form-urlencoded", identifier="Google"
* )
* @Response(200, body={
* "access_token": "usUuownG2hpAsZ6E8LWVRpLHIIlu2rd31d4QBRtk",
* "token_type": "Bearer",
* "expires_in": 111600,
* "refresh_token": "EDhqltSv5k4Iivj1ayhlHSrIVH86gXs6VhyKeuSP"
* }))
*
* @Response(403, body={
* "code": 403,
* "message": "Invalid access token from the provider"
* }))
* @Response(409, body={
* "code": 190,
* "message": "Error validating access token: Session has expired on Wednesday, 15-Jun-16 08:00:00 PDT. The current time is Wednesday, 15-Jun-16 08:10:10 PDT."
* }))
*
* @Response(409, body={
* "code": 409,
* "message": "Missing {$key} field. User did'nt granted the `profile` permission"
* }))
*
* @return \Illuminate\Http\JsonResponse
*
* @throws \Exception
*/
converted to
## Authorizes user in auth with the providers grant type (facebook or google). [POST /external]
For google you must authorize:
- userinfo.email
- userinfo.profile
For Facebook you need to authorze:
- email
- public_profile
+ Request Facebook (application/x-www-form-urlencoded)
+ Body
grant_type=facebook&client_secret=x&client_id=x&access_token=token_from_external_provider
+ Response 200 (application/json)
+ Body
{
"access_token": "usUuownG2hpAsZ6E8LWVRpLHIIlu2rd31d4QBRtk",
"token_type": "Bearer",
"expires_in": 111600,
"refresh_token": "EDhqltSv5k4Iivj1ayhlHSrIVH86gXs6VhyKeuSP"
}
@pionl I believe you're looking for @Transaction. :)
+1
@bradbernard did you have a specific question about this? As of the latest version of dingo/api, you shouldn't have any issues installing.
You must then modify your composer.json file and run composer update to include the latest version of the package in your project.
"require": {
"dingo/api": "1.0.*@dev"
}
Don't composer require dingo/api:1.0.x@dev
I just add to .env file:
API_PREFIX=api
And it works!
In routes/api.php:
Route::get('ping', 'Auth\LoginController@ping');In Auth/LoginController.php:
public function ping()
{
return response()->json([
'message' => 'pong',
]);
}
protected function registerConfig()
{
$this->mergeConfigFrom(realpath(__DIR__.'/../../config/api.php'), 'api');
if (! $this->app->runningInConsole() && empty($this->config('prefix')) && empty($this->config('domain'))) {
throw new RuntimeException('Unable to boot ApiServiceProvider, configure an API domain or prefix.');
}
}
I find 'prefix' in config/api.php and found 'API_PREFIX'
I just add to .env file:
API_PREFIX=api
And it works!
When I remove API_PREFIX: # API_PREFIX=api
the error came back:
Failed to load http://127.0.0.1:8000/api/login: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header
Most helpful comment
You must then modify your composer.json file and run composer update to include the latest version of the package in your project.
Don't
composer require dingo/api:1.0.x@dev