mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-29 08:16:43 -04:00
31 lines
777 B
PHP
31 lines
777 B
PHP
<?php
|
|
|
|
namespace Modules\Shipping\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class UpdateShippingRequest extends FormRequest
|
|
{
|
|
|
|
public function rules()
|
|
{
|
|
return [
|
|
'method_name' => ['required','max:255',Rule::unique('shipping_methods', 'method_name')->where(function($q){
|
|
$seller_id = getParentSellerId();
|
|
return $q->where('id', '!=', $this->id)->where('request_by_user', $seller_id);
|
|
})],
|
|
'carrier_id' => 'nullable',
|
|
'cost_based_on' => 'required',
|
|
'cost' => 'required',
|
|
'method_logo' => 'nullable|mimes:jpg,jpeg,bmp,png'
|
|
];
|
|
}
|
|
|
|
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
}
|