Initial commit
This commit is contained in:
32
api/app/Http/Requests/Admin/StoreEventRequest.php
Normal file
32
api/app/Http/Requests/Admin/StoreEventRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreEventRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:5000'],
|
||||
'slug' => ['nullable', 'string', 'max:100', 'unique:events,slug', 'regex:/^[a-z0-9]+(?:-[a-z0-9]+)*$/'],
|
||||
'google_drive_folder_id' => ['nullable', 'string', 'max:255'],
|
||||
'google_drive_folder_name' => ['nullable', 'string', 'max:255'],
|
||||
'is_active' => ['boolean'],
|
||||
'upload_start_at' => ['nullable', 'date'],
|
||||
'upload_end_at' => ['nullable', 'date', 'after:upload_start_at'],
|
||||
'max_file_size_mb' => ['integer', 'min:1', 'max:2000'],
|
||||
'allowed_extensions' => ['array'],
|
||||
'allowed_extensions.*' => ['string', 'in:mp4,mov,avi,mkv,webm,jpg,jpeg,png'],
|
||||
'require_password' => ['boolean'],
|
||||
'upload_password' => ['nullable', 'string', 'min:4', 'max:100'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user