change the migration columns and add form request
This commit is contained in:
40
app/Http/Requests/V3/Azmayesh/StoreRequest.php
Normal file
40
app/Http/Requests/V3/Azmayesh/StoreRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
40
app/Http/Requests/V3/Azmayesh/UpdateRequest.php
Normal file
40
app/Http/Requests/V3/Azmayesh/UpdateRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/V3/AzmayeshSample/StoreRequest.php
Normal file
29
app/Http/Requests/V3/AzmayeshSample/StoreRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/V3/AzmayeshSample/UpdateRequest.php
Normal file
29
app/Http/Requests/V3/AzmayeshSample/UpdateRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user