Let's get started quickly I found new things in Laravel 8.78 Released I wanted to share with you.
- For example, if you uncheck a form checkbox input it is not sent to the server. You might have to write something like the following
if ($request->missing('boolean_setting')) {
$request->merge(['boolean_setting' => 0]);
}
Now you can define values that are merged with the request if missing
$request->mergeIfMissing(['boolean_setting' => 0]);
$request->boolean_setting;
- the ability to define custom validation rules that will run as part of default password rules using the rules() method The rules() method accepts a single rule, an array of rules, or a closure for a closure validation rule
Password::defaults(function () {
return Password::min(8)
->symbols()
->mixedCase()
->uncompromised()
->rules(new ZxcvbnRule());
});
- add schedule:clear-mutex command https://github.com/laravel/framework/pull/40135
php artisan schedule:clear-cache
- Add method to add multiple lines as once https://github.com/laravel/framework/pull/40147 https://github.com/laravel/framework/pull/40147/files
- Sort collections by key when first element of sort ope ration is string (even if callable) https://github.com/laravel/framework/pull/40212
$collection = collect([
['name' => 'Taylor Otwell', 'sort' => 34],
['name' => 'Abigail Otwell', 'sort' => 30],
['name' => 'Taylor Otwell', 'sort' => 36],
['name' => 'Abigail Otwell', 'sort' => 32],
]);
$sorted = $collection->sortBy([
['name', 'asc'],
['sort', 'desc'],
]);
- Assert Batch Count assertBatchCount() method to the Bus facade, which asserts how many batches have been dispatched
Bus::assertBatchCount(3);
- HTML String Method toHtmlString() method to Str and Stringable
// Before
new HtmlString(Str::of($content)->markdown());
// After
Str::of($content)
->markdown()
->html();
- Lazy Loading Eloquent Results
$flights = Flight::where('de', true)->lazy(100);
$flights->each->archive();
$flights = Flight::where('de', true)->lazyByIdDesc(100);
- Adding Full-text Indexes
$table->string('name')->fulltext();
- Hiding Columns in "select *" Statements
$table->string('password')->invisible();
- New allowIf() & denyIf() Gate Methods
- Retrieve Request Input as Carbon Instances
$request->date('when', 'Y-m-d', 'Africa/Cairo');
Sources :- https://www.youtube.com/watch?v=OdxVhb_kfvE
Sources :- https://laravel-news.com/laravel-8-78-0
Sources :- https://www.youtube.com/watch?v=0tDGI2IPv5Q
I hope you have fun.
Top comments (0)