Answers for "numeric validation in laravel 8,2"

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 "numeric validation in laravel 8,2"

Browse Popular Code Answers by Language