35 lines
878 B
PHP
35 lines
878 B
PHP
<?php
|
|
|
|
namespace Modules\Package\app\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CreatePackageRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => 'required|string',
|
|
'description' => 'required|string',
|
|
'country_id' => 'required',
|
|
'price' => 'required',
|
|
'duration' => 'required',
|
|
'group_size' => 'required|numeric',
|
|
'ordering' => 'required|numeric',
|
|
'image' => 'sometimes|nullable|image|mimes:jpeg,png,jpg,gif',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
// return auth()->user()->can('users.create');
|
|
}
|
|
}
|