Edit File: Settlement.php
<?php namespace App\Http\Requests\Admin\Delegate; use Illuminate\Foundation\Http\FormRequest; use App\Http\Requests\ApiRequest; class Settlement extends ApiRequest { /** * 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() { return [ 'user_id' => 'required|exists:users,id', 'balance' => 'required|numeric', 'method' => 'required|in:with_hand,hypersplit', // 'type' => 'required_if:method,hypersplit|in:bank_account,iban', 'phone' => 'sometimes|numeric', 'bank_iban_number' => 'required_if:type,iban', 'bank_account' => 'required_if:type,bank_account', ]; } public function messages(){ return [ 'balance.required' => trans('auth.bal_req'), 'method.required' => trans('auth.met_req'), ]; } }
Back to File Manager