src/Http/Requests/StoreRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'type'                  => 'nullable|in:'.implode(',', Expense::getTypes()),
            'name'                  => 'required|string',
            'amount'                => ['required', new PriceAmount],
            'amount_without_vat'    => ['nullable', new PriceAmount],
            'number'                => 'nullable|string|max:100',
            'supplier_id'           => 'required|integer|exists:contacts,id',
            'purchaser_id'          => 'required|integer|exists:contacts,id',
            'date_issue'            => 'nullable|date_format:Y-m-d',
            'date_supply'           => 'nullable|date_format:Y-m-d',
            'date_due'              => 'nullable|date_format:Y-m-d',
            'variable_symbol'       => 'nullable|digits_between:0,10',
            'specific_symbol'       => 'nullable|digits_between:0,10',
            'description'           => 'nullable|string',
            'custom_properties'     => 'nullable|array',
        ];
    }
public function rules ( ) { return [ 'type' => 'nullable|in:' . implode ( ',' , Expense :: getTypes ( ) ) , 'name' => 'required|string' , 'amount' => [ 'required' , new PriceAmount ] , 'amount_without_vat' => [ 'nullable' , new PriceAmount ] , 'number' => 'nullable|string|max:100' , 'supplier_id' => 'required|integer|exists:contacts,id' , 'purchaser_id' => 'required|integer|exists:contacts,id' , 'date_issue' => 'nullable|date_format:Y-m-d' , 'date_supply' => 'nullable|date_format:Y-m-d' , 'date_due' => 'nullable|date_format:Y-m-d' , 'variable_symbol' => 'nullable|digits_between:0,10' , 'specific_symbol' => 'nullable|digits_between:0,10' , 'description' => 'nullable|string' , 'custom_properties' => 'nullable|array' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .