Blog Detail

6

Jul
What's new in Laravel 8.48 - Laravel 8.48 Released cover image

What's new in Laravel 8.48 - Laravel 8.48 Released

Laravel is a web application framework with an expressive and concise syntax. A web framework provides a structure and origin point for creating your application, permitting you to focus on creating something extraordinary while we sweat the details.

Laravel tries to render a wondrous developer experience while providing powerful peculiarities such as thorough dependency injection, a strong database abstraction layer, queues and scheduled jobs, unit and integration testing, and more.

Now the Laravel team released 8.48 with the most required filesystem disk, the ability to prune failed queue jobs, and the most advanced changes in the 8.x branch.

Prune Failed Queue Jobs Command

Mohamed Said contributed the ability to prune stale entries from the failed jobs table:

Default 24 hours
php artisan prune:failed

Specify hours
php artisan prune:failed --hours=12

Build an on-Demand Filesystem Disk

Andrew Brown contributed an on-demand filesystem disk, which permits you to configure a filesystem disk spontaneously.

 // String uses the local driver
 Storage::build(storage_path('logs'));

 // Full control over configuration
 Storage::build([
  'driver' => 'local',
  'root' => 'my-custom-path',
  'url' => 'my-custom-url',
  'visibility' => 'public',
]);

Macroable HTTP Client

Tim Robertson comes up with the HTTP Client macroable:

Having the Request macroable will authorize the elimination of excess boilerplate code when we are faking HTTP requests with body content other than Form or JSON, XML, for example;

Here you can see the example pull request’s description:

Request::macro('xml', function () {
  return CustomSuperDuperXmlParser::parse($this->body());
 });

 Http::fake([
  'example.com/*' => function (Request $request) {
  $this->assertSame($request->xml()->someProperty, 'some value')
  return Http::response();
 },
]);

Custom Event Stub File

Ryan Chandler provided the capability to customize the event.stub used in the make:event command.

If you’re curious about publishing and customizing stubs in your application, you can see Customizing Stubs in Laravel

Added GIF, WEBP, WBMP, BMP support to FileFactory::image()

Amir Reza Mehrbakhsh extended the support for GIF, WEBP, WBMP, and BMP when formulating test file uploads. This PR updates the code to verify the file extension and create the proper test image.

v8.48.0

Added

  1. Added a queue:prune-failed command (#37696, 7aca658)

  2. Added Illuminate/Filesystem/FilesystemManager::build() (#37720, c21fc12)

  3. Allow customising the event.stub file (#37761)

  4. Added Illuminate/Collections/Collection::sliding() and Illuminate/Collections/LazyCollection::sliding() (#37751)

  5. Make Illuminate\Http\Client\Request macroable (#37744)

  6. Added GIF, WEBP, WBMP, BMP support to FileFactory::image() (#37743)

  7. Dispatch ‘connection failed’ event in http client (#37740

Published at : 06-07-2021

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

web application development client
web application development client
web application development client
web application development client
web application development client

Launch project