<?php namespace App\Http\Requests\Admin; use Gate; use Illuminate\Foundation\Http\FormRequest; class UpdateStockLocationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return Gate::allows('stock_location_edit'); } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'location' => [ 'required', 'unique:stock_locations,location,' . request()->route('stock_location')->id, 'string', 'max:50', ], 'status' => [ 'required', 'in:0,1', ], ]; } }