hwo to use validator parm in case in laravel? code example
Example 1: laravel validate integer between
'item' => 'required|integer|between:1,10',
Example 2: laravel validation
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
}
public function boot()
{
Validator::extend('foo', function ($attribute, $value, $parameters, $validator) {
return $value == 'foo';
});
}
}