creat controller ,request and route about damage and fix model

This commit is contained in:
2025-02-17 13:55:02 +03:30
parent 8e2857f3c2
commit 469fc351f5
9 changed files with 254 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\V3\Damage;
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 [
'title' =>'required|string|max:255|unique:damages,title',
'unit' =>'required|string|max:255',
'base_price' =>'required|integer',
'status' =>'required|in:0,1',
];
}
}