DEV Community

Morcos Gad
Morcos Gad

Posted on

4 3

New Things Added - Laravel 9.15 Released

Let's get started quickly I found new things in Laravel 9.15 Released I wanted to share with you.

  • Only vendors listed in route:list command

--only-vendor flag to the route:list command. Only vendor routes will appear in the terminal, and the command will ignore your application routes

php artisan route:list --only-vendor
Enter fullscreen mode Exit fullscreen mode
  • HTTP client "throw unless" method

throwUnless() function to the Laravel HTTP client. This method will throw an exception if a server or client error occurred and the given condition is false

$response = Http::post(/* ... */);
$response->throwUnless($condition);
Enter fullscreen mode Exit fullscreen mode
  • String isJson() method

isJson() method to the Str and Stringable classes to determine if a string is valid json

Str::isJson($data); //=> boolean

Str::of($data)->isJson() //=> boolean

str($data)->isJson(); //=> boolean
Enter fullscreen mode Exit fullscreen mode
  • Check if a filesystem directory is empty

two methods to determine if a filesystem directory is empty or not

use Illuminate\Support\Facades\File;

if (File::isDirectoryEmpty('john/photos')) {
    return 'You do not have any photos';
}

if (File::isDirectoryNotEmpty('john/videos', true)) {
    return 'You may have one or more videos, even hidden ones.';
}
Enter fullscreen mode Exit fullscreen mode

I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.
Source :- https://laravel-news.com/laravel-9-15-0

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay