Answers for "hwo to use validator parm in case in laravel?"

PHP
2

laravel validate integer between

'item' => 'required|integer|between:1,10',
Posted by: Guest on October-21-2020
0

laravel validation

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Validator::extend('foo', function ($attribute, $value, $parameters, $validator) {
            return $value == 'foo';
        });
    }
}
Posted by: Guest on December-25-2020

Code answers related to "hwo to use validator parm in case in laravel?"

Browse Popular Code Answers by Language