digits_between Validation In Laravel 8
Hello Dev,
At present, i we’ll present you digits_between validation in laravel 8. This text gives you easy instance of digits_between validation in laravel 8. you’ll digits_between validation in laravel 8. So let’s observe few step to create instance of digits_between validation in laravel 8.
Answer:
$request->validate([ 'amount' => 'required|digits_between:1,2' ]);
Add Route:
use AppHttpControllersValidationController; Route::get('digits-between',[ValidationController::class,'digitsBetweenValidation']); Route::publish('store-digits-between',[ValidationController::class,'digitsBetweenStore'])->title('retailer.digits.between');
Controller:
app/Http/Controllers/ValidationController.php
<?php namespace AppHttpControllers; use IlluminateHttpRequest; class ValidationController extends Controller { public operate digitsBetweenValidation() { return view('validation.digitsBetweenValidation'); } public operate digitsBetweenStore(Request $request) digits_between:1,2', ]); }
View:
assets/views/validation/lteValidation.php
<!DOCTYPE html> <html> <head> <title>digits_between Validation In Laravel 8 </title> <hyperlink rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" ></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js" ></script> <hyperlink rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js" ></script> </head> <physique> <div class="container mt-5"> <div class="row"> <div class="col-md-Eight offset-2 mt-5"> <div class="card"> <div class="card-header bg-info text-white"> <h3>digits_between Validation In Laravel 8 </h3> </div> <div class="card-body"> <kind motion="{{ route('retailer.digits.between') }}" methodology="publish"> @csrf <div class="form-group"> <label>Quantity :</label> <enter class="form-control" title="quantity" worth="{{ outdated('quantity') }}"> @if($errors->has('quantity')) <span class="text-danger">{{ $errors->first('quantity') }}</span> @endif </div> <div class="form-group"> <button class="btn btn-success btn-sm">Save</button> </div> </kind> </div> </div> </div> </div> </div> </physique> </html>
Run:
php artisan serve
I hope it should help you…
Komentar
Posting Komentar