Laravel 7.6.0 Out

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 of all, HtmlString::isEmpty()makes it 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 the Stringable class to crop character strings at the beginning or end ltrimand rtrimmedhod:

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

Route Middleware Jump Feature

When defining route, middleware contributed to the jump feature:

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

Http Client: JSON Response Object

Adrian Nuremberger object()contributed to the method of returning a JSON response body as an object instead of an associable array:

Array access
Http://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

Below is the full list of new features and updates, 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 )
  • Added Middleware jump feature ( #32347 , 412261c )
  • Illuminate\Http\Client\Response::object()method ( # 32341 )
  • Component name change ( #32346 )
  • Illuminate\Database\Eloquent\Collection::append()method ( # 32324 )
  • Added jfinal format for Composer( #32310 )

constant

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

Updated

  • Added default value to Constructor HtmlString# 32290 )

  Quote

KARABAY A, 2020 . Laravel 7.6.0 Out,

https://www.karabayyazilim.com/blog/laravel-760-cikti-2020-04-15-233241

(Accessed April 15, 2020).


  Share this post

Comments (0)

Comment

Subscribe
Sign up for the email newsletter to be the first to know about my blog posts