Let's get started quickly I found new things in Laravel 9.8 Released I wanted to share with you.
- The "old" Form Helper Accepts a Model https://github.com/laravel/framework/pull/41842
<input type="text" name="name" value="{{ old('name', $user->name) }}">
<input type="text" name="name" value="{{ old('name', $user) }}">
- Discover Anonymous Blade Components in Additional Paths https://github.com/laravel/framework/pull/41637
public function boot()
{
Blade::anonymousComponentNamespace('flights.bookings', 'flights');
}
Here's an example of anonymous component usage
<x-flights::panel :flight="$flight" />
- 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();
- Allow a Custom Log Level in Exception Handling https://github.com/laravel/framework/pull/41925
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
];
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
Top comments (0)