My Blog Posts

Laravel 7.6.0 Released

Laravel 7.6.0 Released


The Laravel team released v7.6.0 with new features.

String Empty Methods

Mark van den Broek contributed several methods for Stringable and HtmlString. First, HtmlString::isEmpty()easy to control an empty array:

$string = new \Illuminate\Support\HtmlString(''); // Previously
if (empty($string-toHtml())
// Using isEmpty
if ($string->isEmpty())

Secondly, isNotEmpty():

use Illuminate\Support\Stringable; (new Stringable())->isNotEmpty(); // false
(new Stringable('Hello World')->isNotEmpty(); True

Stringable Trim Methods

Ryan Chandler contributed to stringable class to crop at the beginning or end of character strings LtrimAnd rtrimmedhod:

use Illuminate\Support\Stringable; echo (new Stringable(' Hello World'))-ltrim(); // 'Hello World'
echo (new Stringable('Hello World '))-rtrim(); 'Hello World'
echo (new Stringable('/example/')-rtrim('/'); '/example'

Route Middleware Jump Feature

Route contributed to middleware jumping when defining:

Route::get('/something')
->skipMiddleware(VerifyCsrfToken::class)
Route::get('/teams/create')
->skipMiddleware(VerifyUserHasTeam::class)

Http Client: JSON Response Object

Adrian Nuremberger object()a JSON response body contributed to the method of rotating it as an object instead of the associative array:

Array access
Http://get('some-api.wip')['result'];
// Using json()
$response = Http://get('some-api.wip')-json();
$response['result']
// New option
$response = Http://get('some-api.wip')-object();
$response->result;

Release notes

The full list of new features and updates is below and you can see the differences between 7.5.0 and 7.6.0 on GitHub.

v7.6.0

Added

  • Collection::until()method ( # 32262 )
  • HtmlString::isEmpty()method ( # 32289 , # 32300 )
  • Illuminate\Support\Stringable::isNotEmpty()method ( # 32293 )
  • ltrim()And rtrim() method added( # 32288 )
  • Middleware jump feature added ( #32347 , 412261c )
  • Illuminate\Http\Client\Response::object()method ( # 32341 )
  • Component name change ( #32346 )
  • Illuminate\Database\Eloquent\Collection:append()method ( # 32324 )
  • Added jlast format for Composer( #32310 )

Fixed

  • CURRENT_TIMESTAMP error fixed Illuminate\Database\Schema\Grammars\MySqlGrammar# 32298 )

Updated

  • Default value added to Constructor Htmlstring# 32290 )



Share this article


Comments (0)

Comment