lundi 9 novembre 2015

How to validate Money in Laravel5 request class

My Validation class looks like this

<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class PaymentRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = array(

                       'invoiceid'=>'required',
                       'recieved_amount'=>'required',
                       'ref_no'=>'required',
                       'date'=>'required',
                       'comment'=>'required'
                       );


    }
}

I want to validate recieved_amount as Money field Like if anything other than money is entered it should be validated

Can any one help me in this



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire