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()
|
|
|
|
{
|
2024-04-25 05:27:45 +00:00
|
|
|
return Gate::allows('admin');
|
2023-08-03 07:30:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
2023-12-18 04:13:16 +00:00
|
|
|
Rule::in(our_address()->pluck('id')),
|
2023-08-03 07:30:52 +00:00
|
|
|
],
|
|
|
|
'tftn_id' => [
|
|
|
|
'required',
|
|
|
|
Rule::in($this->route('o')->akas->pluck('id')),
|
|
|
|
],
|
|
|
|
'subject' => 'required|min:1|max:8',
|
|
|
|
'msg' => 'required|min:1',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|