change the migration columns and add form request

This commit is contained in:
2024-11-03 06:26:26 +00:00
parent e9098b0a55
commit 1a15a5d7ed
16 changed files with 444 additions and 66 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests\V3\Azmayesh;
use Illuminate\Foundation\Http\FormRequest;
class StoreRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'lat' => 'required|string',
'lng' => 'required|string',
'azmayesh_type_id' => 'required|exists:azmayesh_types,id',
'request_date' => 'date',
'report_date' => 'date',
'request_number' => 'string',
'employer' => 'string',
'contractor' => 'string',
'work_number' => 'string',
'project_name' => 'required|string',
'consultant' => 'string',
'applicant' => 'string',
'province_id' => 'required|exists:provinces,id',
];
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests\V3\Azmayesh;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'lat' => 'required|string',
'lng' => 'required|string',
'azmayesh_type_id' => 'required|exists:azmayesh_types,id',
'request_date' => 'date',
'report_date' => 'date',
'request_number' => 'string',
'employer' => 'string',
'contractor' => 'string',
'work_number' => 'string',
'project_name' => 'required|string',
'consultant' => 'string',
'applicant' => 'string',
'province_id' => 'required|exists:provinces,id',
];
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests\V3\AzmayeshSample;
use Illuminate\Foundation\Http\FormRequest;
class StoreRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'azmayesh_id' => 'required|exists:azmayeshes,id',
'data' => 'required',
];
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests\V3\AzmayeshSample;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'azmayesh_id' => 'required|exists:azmayeshes,id',
'data' => 'required',
];
}
}