phpvms/app/Http/Requests/CreateSubfleetRequest.php

32 lines
594 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use App\Models\Subfleet;
use Illuminate\Foundation\Http\FormRequest;
class CreateSubfleetRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
2018-08-27 00:40:04 +08:00
*
* @return bool
*/
2018-03-22 01:35:06 +08:00
public function authorize(): bool
{
return true;
}
/**
* 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 = Subfleet::$rules;
$rules['type'] .= '|unique:subfleets';
return $rules;
}
}