dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

namespace Dingo\Api\Exception not work in laravel 5.8 #1624

Closed fcorz closed 5 years ago

fcorz commented 5 years ago

laravel-framework file namespace Illuminate\Contracts\Debug has upgrade , this interface add this function public function shouldReport(Exception $e); but This interface is not implemented please check and fix it. thx.

mallardduck commented 5 years ago

Here are the relevant areas from Laravels upgrade guide. https://laravel.com/docs/5.8/upgrade#exception-handling

mallardduck commented 5 years ago

This error is only the first in a number of them that we'll experience using Laravel 5.8. I've updated the PR to address all the errors - however, even with those, this isn't fixing the builds since the tests require Lumen and Lumen hasn't been released for 5.8 yet.

specialtactics commented 5 years ago

Resolved, I will tag this as 2.1

SOSTheBlack commented 5 years ago

update the package version (Y) "dingo/api": "^2.1",

specialtactics commented 5 years ago

@SOSTheBlack ? Do you want to elaborate what you mean there?

SOSTheBlack commented 5 years ago

@specialtactics Add this in your composer.json file "require": { "php": ">=7.1.3", "dingo/api": "^2.1", ...

specialtactics commented 5 years ago

@SOSTheBlack Are you saying you are having issues still? If so, please post your complete composer.json file, because I cannot reproduce.

soumyaRauth commented 5 years ago

@specialtactics

This is the error message I receive when I run composer update: PHP Fatal error: Class App\Exceptions\Api\Handler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Contracts\Debug\ExceptionHandler::shouldReport) in /Users/dev/Web/laravel58/app/Exceptions/Api/Handler.php on line 33

In Handler.php line 33:

Class App\Exceptions\Api\Handler contains 1 abstract method and must theref
ore be declared abstract or implement the remaining methods (Illuminate\Con
tracts\Debug\ExceptionHandler::shouldReport)

Here is my composer.json:

{ "name": "My Test API", "description": "Starter Boiler Plate", "keywords": ["REST API", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=7.1.3", "laravel/framework": "^5.8", "dingo/api": "^2.1", "tymon/jwt-auth": "^0.5", "stevenmaguire/laravel-middleware-csp": "^0.1.1", "prettus/laravel-validation": "^1.1", "illuminate/support": "^5.3", "darkaonline/l5-swagger": "^5.8" }, "require-dev": { "fzaninotto/faker": "^1.4", "mockery/mockery": "^0.9", "symfony/css-selector": "^3.1", "symfony/dom-crawler": "^3.1", "barryvdh/laravel-debugbar": "^3.2" }, "autoload": { "classmap": [ "database", "app/Models/User", "app/Models/Locality", "app/Models/Contents", "app/Models/System", "app/Models/Notifications", "app/Facades", "app/Repository", "app/Services" ], "psr-4": { "App\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-root-package-install": [ "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "php artisan key:generate" ], "post-install-cmd": [ "Illuminate\Foundation\ComposerScripts::postInstall", "php artisan optimize" ], "post-update-cmd": [ "Illuminate\Foundation\ComposerScripts::postUpdate", "php artisan optimize" ] }, "config": { "preferred-install": "dist" } }

specialtactics commented 5 years ago

@soumyaRauth that composer file works fine for me.

Also, the file "App\Exceptions\Api\Handler" is actually inside of your own application - not dingo or any other package, so I suspect the problem lies in your own code.