- add code parameters into config - add code length parameter into settings - add total possible codes to generate in generation page - add GenerateRequest validation - changed job ProcessUniqueCode to increase performances using mass insert and pagination - changed singletoned Settings instance to increase performances - Fix process export code put datetime in file name - aded storage to gitignore file - fixed export to guess export codes, also non recursive now - changed refactorize a bit EnterCodeController::participate + add request - Add request to export and generate codes requests
32 lines
667 B
PHP
32 lines
667 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class GenerateCodesRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
// ? Is auth and super admin
|
|
return auth()->check() and auth()->user()->role === 1;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'quantity' => 'required|integer|min:1',
|
|
'code_length' => 'required|integer|min:1',
|
|
];
|
|
}
|
|
}
|