mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlusWtiiabaddon\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StudioPlusIncentiveRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'title' => ['required'],
|
|
'description' => ['required'],
|
|
'contentTypes' => ['nullable'],
|
|
'contentVariants' => ['nullable'],
|
|
'videoTypes' => ['nullable'],
|
|
'roles' => ['required', 'array'],
|
|
'incentive_category_id' => ['required', 'exists:studio_plus_incentive_categories,id'],
|
|
'target_rule' => ['required'],
|
|
'amount_value_earned' => ['required'],
|
|
'asins' => ['nullable', 'array']
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'role_id.required' => 'The user role field is required.',
|
|
'asin_id.required' => 'The asin value field is required.',
|
|
'incentive_category_id.required' => 'The category field is required.'
|
|
];
|
|
}
|
|
}
|