DEV Community

Morcos Gad
Morcos Gad

Posted on • Updated on

New Things Added - Laravel 9.8 Released

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

<input type="text" name="name" value="{{ old('name', $user->name) }}">

<input type="text" name="name" value="{{ old('name', $user) }}">
Enter fullscreen mode Exit fullscreen mode
public function boot()
{
    Blade::anonymousComponentNamespace('flights.bookings', 'flights');
}
Enter fullscreen mode Exit fullscreen mode

Here's an example of anonymous component usage

<x-flights::panel :flight="$flight" />
Enter fullscreen mode Exit fullscreen mode
  • Set Factory Method
// Before
EloquentModel::factory()->create(['name' => 'foo']);

// After
EloquentModel::factory()->set('name', 'foo')->create();

// Before
EloquentModel::factory()->someMethod()->create(['country' => 'NL']);

// After
EloquentModel::factory()->someMethod()->set('country', 'NL')->create();
Enter fullscreen mode Exit fullscreen mode
use PDOException;
use Psr\Log\LogLevel;

/**
 * A list of exception types with their corresponding custom log levels.
 *
 * @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
 */
protected $levels = [
    PDOException::class => LogLevel::CRITICAL
];
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-8-0
Source :- https://www.youtube.com/watch?v=_qVcZ6jJgr4

Discussion (0)