Vigyata.AI
Is this your channel?

A New Method To Read And Decode a JSON File - 2 New Things Added New in Laravel 10.5.0

2.6K views· 69 likes· 2:58· Apr 4, 2023

🛍️ Products Mentioned (6)

Here, we will be looking at 2 new things that are added to the latest version of Laravel which is v10.5.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/v10.4.1...v10.5.1 00:00 Intro 00:22 Add caseSensitive flag to Stringable replace function https://github.com/laravel/framework/pull/46578 01:01 Add Storage::json() method to read and decode a json file https://github.com/laravel/framework/pull/46548 02:04 Cloudways Sponsorship === Other Videos === 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 covering two small but really useful additions in Laravel v10.5.0 that can make your day-to-day code a bit cleaner and more convenient. First, I show you the new caseSensitive flag on the Stringable/Str replace function. By default, replace is case sensitive, so it only swaps matching characters with the same casing. But now you can pass a third parameter to make it case-insensitive, which means it will replace both capital and small letters in one go. The second update is my favorite here: the new Storage::json() method. Previously, reading a JSON file from storage usually meant a couple of steps—get the file contents and then decode it. Now it’s a single line: Storage::json('path/to/file.json'), and Laravel will read and decode the JSON for you. I also quickly explain how this maps to your filesystem disk (like the default local disk pointing to storage/app), so you know exactly where Laravel is reading from. Simple changes, but they add up when you’re trying to keep your Laravel code clean.

Frequently Asked Questions

🎬 More from Laratips