DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 968,547 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Morcos Gad
Morcos Gad

Posted on • Updated on

Features (without timestamps - Str wrap static method and ... ) Laravel 9.31

In the new version 9.31 we have Some of the new features.

withoutTimestamps() method where updated_at will not change

$user = User::first();

// `updated_at` is not changed...
User::withoutTimestamps(
    fn () => $user->update(['reserved_at' => now()])
);
Enter fullscreen mode Exit fullscreen mode
  • Model getAppends() method

added an accessor method to Model to get the accessors that are being appended to model arrays. This could be useful for custom model mappings

$model->getAppends();
Enter fullscreen mode Exit fullscreen mode

missing static Str::wrap() method, which was only available via Stringable

Str::wrap('-bar-', 'foo', 'baz'); // 'foo-bar-baz'
str('-bar-')->wrap('foo', 'baz'); // 'foo-bar-baz'
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-31-0
Source :- https://www.youtube.com/watch?v=-g7BRU7L78c

Top comments (0)

πŸ‘‹ Hey, my name is Noah and I’m the one who set up this ad. My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.

If you found DEV from searching around, here are a couple of our most popular articles on DEV: