add new columns to harim cartables
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\Deputy;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ConfirmRoadAccessRequest extends FormRequest
|
||||
@@ -19,7 +20,7 @@ class ConfirmRoadAccessRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -12,11 +12,7 @@ class ShowRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
in_array($this->harim->state_id, [
|
||||
HarimStates::BARESI_TAVASOT_MOAVEN->value,
|
||||
HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_MOAVEN->value,
|
||||
]);
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,7 @@ class ShowRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
in_array($this->harim->state_id, [
|
||||
HarimStates::BARESI_TAVASOT_MODIR_KOL->value,
|
||||
HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_MODIR_KOL->value
|
||||
]);
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ class NeedRoadAccessRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
'need_payment' => 'required|in:0,1',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\HarimOffice;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ShowRequest extends FormRequest
|
||||
@@ -12,18 +13,14 @@ class ShowRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
in_array($this->harim->state_id, [
|
||||
HarimStates::BARESI_TAVASOT_DAFTAR_HARIM->value,
|
||||
HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_DAFTAR_HARIM->value,
|
||||
]);
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ class WithoutRoadAccessRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
'need_payment' => 'required|in:0,1',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class FeedBackRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
'forbidden_area' => 'required|array',
|
||||
'forbidden_area.type' => 'required|string',
|
||||
'forbidden_area.coordinates' => 'required|array',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ class ShowRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::BARESI_EDARE_SHAHRESTAN->value;
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user