clrghouz/app/Http/Requests/AreafixRequest.php

40 lines
749 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use App\Models\Setup;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
class AreafixRequest extends FormRequest
{
public function authorize()
{
2024-04-25 05:27:45 +00:00
return Gate::allows('admin');
}
public function rules(Request $request)
{
if (! $request->isMethod('post'))
return [];
return [
'to' => [
'required',
Rule::in(config('fido.areafilefix')),
],
'fftn_id' => [
'required',
Rule::in(our_address()->pluck('id')),
],
'tftn_id' => [
'required',
Rule::in($this->route('o')->akas->pluck('id')),
],
'subject' => 'required|min:1|max:8',
'msg' => 'required|min:1',
];
}
}