Vigyata.AI
Is this your channel?

New Array To Enum Collection Casting - 7 New Things Added - New in Laravel 9.49.0

2.0K views· 50 likes· 6:48· Feb 9, 2023

🛍️ Products Mentioned (11)

Here, we will be looking at 7 new things that are added to the latest version of Laravel which is v9.49.0 === OFFER === GET 30% DISCOUNT ON ALL PLANS OF CLOUDWAYS HOSTING FOR 3 MONTHS https://unified.cloudways.com/signup?id=1029148&coupon=CW30FOR3 === Important Links === Fonts, extensions I use, and Support Laratips links: https://bit.ly/m/laratips === Video Related Links === https://github.com/laravel/framework/compare/v9.48.0...v9.49.0 00:00 Intro 00:12 Add support for casting arrays containing enums https://github.com/laravel/framework/pull/45621 02:27 CLI Prompts https://github.com/laravel/framework/pull/45629 03:47 Adds assertJsonIsArray and assertJsonIsObject for TestResponse https://github.com/laravel/framework/pull/45731 05:32 Add forceDeleteQuietly to SoftDeletes https://github.com/laravel/framework/pull/45737 05:49 Add Arr::sortDesc() https://github.com/laravel/framework/pull/45761 06:00 Add new throw helper methods to the HTTP Client https://github.com/laravel/framework/pull/45704 06:26 Add noActionOnDelete method https://github.com/laravel/framework/pull/45712 === Other Videos === What's New In Laravel 9 https://youtu.be/qAzrZUG_9Z0 New In Laravel Playlist https://www.youtube.com/playlist?list=PL2DahmvUpeuu4UVWrcxlvVkMiI0SeS2OZ Laravel Package Development Playlist https://www.youtube.com/playlist?list=PL2DahmvUpeuu8HkpbNT-cKernolVdqZq_ Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols: https://youtu.be/f-g3P9imPZs Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature: https://youtu.be/vzgNm86ezWE Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution: https://youtu.be/aQCHmB4Uh0Q Laravel Tip - Properly Get Data Between Two Dates https://youtu.be/bJkEBTg1NGA Get Data From Multiple Databases In One Project | Laravel Tip https://youtu.be/KJAXLf78QPs === Attribution === Boy waving hand Video by VideoPlasty .com from Pixabay https://pixabay.com/users/videoplasty-19751245/?utm_source=link-attribution&utm_medium=referral&utm_campaign=video&utm_content=80696 #laravel #php #laraveltip #laratips #newinlaravel

About This Video

Hey guys, welcome to Laratips. In this video I’m walking you through 7 new things added in Laravel v9.49.0, and I’m showing them one by one with quick examples so you can actually use them in real projects. The biggest one for me is the new support for casting arrays that contain enums. If you have a JSON column like `types` where a user can have multiple roles/types, you can now cast it as an `enum_collection:YourEnum` directly in the model. When you save, Laravel stores the enum values to the DB, and when you access it, you get a collection of enums back—super powerful because now you can use enum methods/properties instead of working with raw strings. After that I show the new CLI prompts feature. Previously, if you ran an Artisan command without required arguments, you’d just get a “missing argument” error. Now, if you implement the `PromptsForMissingInput` interface, Laravel will ask you interactively for the missing argument. I also cover two new testing assertions—`assertJsonIsArray()` and `assertJsonIsObject()`—so you can properly test the JSON shape (array vs object in the JavaScript sense). Finally, I quickly go over a few smaller additions: `forceDeleteQuietly()` for soft deletes, `Arr::sortDesc()`, new HTTP client throw helpers like `throwIfStatus()` / `throwOnly()`, and the migration helper `noActionOnDelete()`.

Frequently Asked Questions

🎬 More from Laratips