44 lines
968 B
PHP
44 lines
968 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Fo\Orders;
|
|
|
|
use App\Models\Shop\Order;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class ShippingResumeRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return auth('frontend')->check() and Gate::check('orderThings', Order::class);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'acceptCGV' => 'accepted'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the error messages for the defined validation rules.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'acceptCGV.accepted' => __('Les Conditions Générales de Vente doivent être acceptées.'),
|
|
];
|
|
}
|
|
}
|