DEV Community 👩‍💻👨‍💻

Morcos Gad
Morcos Gad

Posted on • Updated on

Great Things - Laravel 9.37 - 9.38 Released

It has a couple of new features that I've found that can help you on your next projects - Laravel 9.37 Released

  • Verbose view caching

the ability to pass -v to the view:cache artisan command to output the directories the command is looking in and -vv to see every file the command caches.

php artisan view:cache -vv
Enter fullscreen mode Exit fullscreen mode
  • Query builder raw value method

rawValue() method to get a value from a SQL expression. Here are some examples from the pull request

$first = TripModel::orderBy('date_at', 'ASC')
    ->rawValue('YEAR(`date_at`)');
$last = TripModel::orderBy('date_at', 'DESC')
    ->rawValue('YEAR(`date_at`)');

$fullname = UserModel::where('id', $id)
    ->rawValue('CONCAT(`first_name`, " ", `last_name`)');
Enter fullscreen mode Exit fullscreen mode
  • Slug helper dictionary

https://github.com/laravel/framework/pull/44730
customizable dictionary for special characters when calling Str::slug()

$ php artisan tinker

>>> Str::slug('500$ bill');
=> "500-bill"

>>> Str::slug(
...     title: '500$ bill',
...     dictionary: ['@' => 'at', '$' => 'dollar']
... );
=> "500-dollar-bill"
Enter fullscreen mode Exit fullscreen mode
  • Add a touchQuietly model convenience method

https://github.com/laravel/framework/pull/44722
touchQuietly() convenience method to touch a model's update timestamp without raising any events

$model->touchQuietly();
Enter fullscreen mode Exit fullscreen mode
  • Isolated Artisan commands

The first artisan command to include the Isolatable interface is the artisan migrate command. Using the --isolated flag you can limit the migrate to one active process and ensures that two servers cannot run the migrate command at the same time

php artisan migrate --isolated
Enter fullscreen mode Exit fullscreen mode

Note: isolated migrations is not the default and was released behind the --isolated flag to reduce the chance of breaking changes.

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-37-0
Source :- https://laravel-news.com/laravel-9-38-0
Source :- https://www.youtube.com/watch?v=SlYECnom3UI

Top comments (0)

🌚 Life is too short to browse without dark mode