--level 5 used: (but already breaks on --level 2Since upgrading to v0.5.5 => v0.5.7 it seems it doesn't recognise Laravels Macro functionality and returns the below error.
------ ------------------------------------------------------------------
Line Exceptions/Handler.php
------ ------------------------------------------------------------------
51 Call to an undefined method
Illuminate\Contracts\Routing\ResponseFactory::unauthenticated().
54 Call to an undefined method
Illuminate\Contracts\Routing\ResponseFactory::unauthenticated().
57 Call to an undefined method
Illuminate\Contracts\Routing\ResponseFactory::notFound().
63 Call to an undefined method
Illuminate\Contracts\Routing\ResponseFactory::tooManyRequests().
------ ------------------------------------------------------------------
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\ServiceProvider;
class ResponseServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*/
public function boot(): void
{
Response::macro('noContent', function () {
return Response::json('', 204);
});
Response::macro('deleted', function () {
return Response::noContent();
});
Response::macro('resetContent', function () {
return Response::json([], 205);
});
}
/**
* Register the application services.
*/
public function register(): void
{
//
}
}
Thank you for your report.
Could you retry with yesterday's release? https://github.com/nunomaduro/larastan/releases
@nunomaduro Is it really a Draft release?
@szepeviktor Yeah, it's still a draft. It's not released yet.
But I doubt the new release will fix these macro issues. We have to take a look at it.
Hi,
This might be fixed with #570 Can you try with the master branch and see if the issue still continues?
The master branch fixed this issue :)! Looking forward to 0.5.9! Thank you very much. This is 1 of my favorite packages which makes code cleanup fun in a game-like way.
Thank you for kind words! Glad it fixed the issue.
BTW, the next version will be 0.6 Because there might be some small breaking changes.
Most helpful comment
Hi,
This might be fixed with #570 Can you try with the
masterbranch and see if the issue still continues?