phpvms/app/Http/Requests/CreateFareRequest.php

22 lines
385 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use App\Contracts\FormRequest;
use App\Models\Fare;
class CreateFareRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
2018-08-27 00:40:04 +08:00
*
* @return array
*/
2018-03-22 01:35:06 +08:00
public function rules(): array
{
2018-03-22 01:35:06 +08:00
$rules = Fare::$rules;
$rules['code'] .= '|unique:fares';
return $rules;
}
}