39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\RoadItemsProject;
|
|
|
|
use App\Models\InfoItem;
|
|
use App\Models\User;
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
use Symfony\Component\Finder\Exception\AccessDeniedException;
|
|
|
|
class UpdateRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
// return !($this->road_item->user_id != auth()->user()->id || $this->road_item->status != 2);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'start_point' => 'required',
|
|
'amount' => 'required|numeric',
|
|
'before_image' => 'image|max:4096',
|
|
'after_image' => 'image|max:4096',
|
|
'cmms_machine_id' => 'required|exists:cmms_machines,id',
|
|
];
|
|
}
|
|
}
|