example I have a view with
{!! Form::text('pagado',$pago, null, ['class' => 'form-control', 'placeholder' => 'Ingrese Cantidad $$$' , 'required']) !!}
- the variables I bring from a database $ payment.
I have a request (PaymentRequest.php)
'pagado' => 'min:2|max:10|integer|required'
- because when I enter a minimum amount of 2 characters validates me and throws the error and does not let me move forward with the save, I mean everything is fine.
then my query is as follows, how can I validate that the entry in Form :: text ('paid') if it is less than the variable $ payment, do not let me save in the form ??. that is not written in the PaymentRequest.php or that validation should only be in the view?
------------------- form of view (paid.blade.php) -------------
@section('title', 'Pagar')
@extends('layouts.admin_template')
@section('content')
@if(count($errors) > 0)
<div class="alert alert-danger" role="alert">
<ul>
@foreach($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
{!! Form::model('payment', ['route' => ['payments.update', $id],'method' =>'PUT', 'onsubmit' => 'return confirm("¿Estas Seguro?")']) !!}
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Pagar</div>
<div class="panel-body">
<!-- Nav tabs -->
<div role="tabpanel">
<br>
<!-- Tab panes -->
<div class="form-group">
{!! Form::label('forma_pago', 'Saldo a Favor: $') !!}
{!! Form::label('0', $saldo) !!} <br>
{!! Form::label('forma_pago', 'Abono: $') !!}
{!! Form::label('abono', $pago_abono) !!} <br><br>
{!! Form::text('pagado',$pago, null, ['class' => 'form-control', 'placeholder' => 'Ingrese Cantidad $$$' , 'required']) !!} <br><br>
{!! Form::select('estado', ['pagado' => 'Pagar', 'abono' => 'Abonar'],null,['class'=> 'form-control']) !!} <br>
{!! Form::checkbox('name', 'value') !!}
{!! Form::label('forma_pago', ' Utilizar Saldo?') !!}
</div>
</div>
<!-- Tab fin -->
<div class="form-group">
{!! Form::submit('Guardar',['class' => 'btn btn-primary'] ) !!}
</div>
@endsection