DEV Community

Morcos Gad
Morcos Gad

Posted on

Laravel 8.70 Released ( can() - date_format )

Let's get started quickly
Taylor Otwell contributed a can() method for route definitions as a convenience. The authorization via middleware documentation has an example of using this method:

// Using the middleware method
Route::put('/post/{post}', function (Post $post) {
    // The current user may update the post...
})->middleware('can:update,post');

// Using the new can() method
Route::put('/post/{post}', function (Post $post) {
    // The current user may update the post...
})->can('update', 'post');
Enter fullscreen mode Exit fullscreen mode

Validation component updates
Now accepts multiple date formats separated by a comma

$request->validate([
  'date' => ['date_format:y-m-d,m-d']
]);
Enter fullscreen mode Exit fullscreen mode

I hope you enjoy the code.

Discussion (0)