I checked the other posts on Stack Overflow, but none of them resolved my issue.
I’m also still learning Laravel, so 100% beginner.
I follow the steps from this article to install it ( composer create-project –prefer-dist laravel/laravel blog
) and wanted to test out the RateLimiter.
But I keep getting the ‘Fatal error: Uncaught Error: Class “IlluminateSupportFacadesRateLimiter” not found’ error.
I made sure that ‘RateLimiter’ => IlluminateSupportFacadesRateLimiter::class’ is in the config/app.php ( it wasn’t there before, but it makes no difference ).
This is the code that I’m testing, which comes from the official documentation.
use IlluminateSupportFacadesRateLimiter;
$executed = RateLimiter::attempt(
'send-message:',
$perMinute = 5,
function() {
echo 'hi';
// Send message...
}
);
if (! $executed) {
return 'Too many messages sent!';
}
I also tried to run composer update again to make sure everything was up to date, and checked if I could maybe download the RateLimiter package here, but I don’t see it.
I do suspect the package is missing, but no idea how to fix, and all suggestions from other posts on Stack Overflow make no difference to me.
Any suggestions what I could check / do to fix this error?