transfer road item project from v2 to v3
This commit is contained in:
36
app/Http/Requests/V3/RoadItemsProject/UpdateRequest.php
Normal file
36
app/Http/Requests/V3/RoadItemsProject/UpdateRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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 !($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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user