Laravel 8.9 Released Infomation
In this post we will give you Laravel 8.9 Released Infomation, hear for Laravel 8.7 Released Infomation we will give you details about it.
The Laravel 8.9 released this week with new rate-limiting constructors and an onError() HTTP client method, along with the latest new features, fixes, and changes in the 8.x branch.
Add Per Hour and Per Day Constructors
User @ali-alharthi contributed perHour and perDay rate limiting for Laravel 8’s new RateLimiter functionality:
use Illuminate\Support\Facades\RateLimiter; RateLimiter::for('global', function (Request $request) { return Limit::perHour(1000); });
Laravel 8 introduces some nice rate limiting improvements you should check out if you haven’t had a chance yet.
HTTP Client onError
Tim MacDonald contributed an onError() method to the HTTP client that accepts a callback:
return $client->withHeaders($headers) ->post($url, $payload) ->onError(fn ($response) => Log::error('Twitter API failed posting Tweet', [ 'url' => $url, 'payload' => $payload, 'headers' => $headers, 'response' => $response->body(), ]) )->json();
As suggested in the pull request, you can now pass a closure to the throw() method which will call the closure before throwing an exception:
return $client->withHeaders($headers) ->post($url, $payload) ->throw(fn($response) => Log::error('Twitter API failed posting Tweet', [ 'url' => $url, 'payload' => $payload, 'headers' => $headers, 'response' => $response->body(), ]))->json();
Artisan Serve “no-reload” Option
Taylor Otwell contributed a –no-reload flag to the Artisan serve command, which does not reload the development server on .env file changes:
php artisan serve --no-reload
Release Notes
You can see the full list of new features and updates below and the diff between 8.8.0 and 8.9.0 on GitHub. The following release notes are directly from the changelog:
Hope this code and post will helped you for implement Laravel 8.9 Released. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs onlincode.org