2023-08-03 07:30:52 +00:00
|
|
|
<?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()
|
|
|
|
{
|
|
|
|
return Gate::allows( 'admin');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules(Request $request)
|
|
|
|
{
|
|
|
|
if (! $request->isMethod('post'))
|
|
|
|
return [];
|
|
|
|
|
|
|
|
return [
|
|
|
|
'to' => [
|
|
|
|
'required',
|
2023-09-22 04:45:44 +00:00
|
|
|
Rule::in(config('fido.areafilefix')),
|
2023-08-03 07:30:52 +00:00
|
|
|
],
|
|
|
|
'fftn_id' => [
|
|
|
|
'required',
|
|
|
|
Rule::in(Setup::findOrFail(config('app.id'))->system->akas->pluck('id')),
|
|
|
|
],
|
|
|
|
'tftn_id' => [
|
|
|
|
'required',
|
|
|
|
Rule::in($this->route('o')->akas->pluck('id')),
|
|
|
|
],
|
|
|
|
'subject' => 'required|min:1|max:8',
|
|
|
|
'msg' => 'required|min:1',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|