29 lines
686 B
PHP
29 lines
686 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Admin\Themes;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class UploadThemeRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return $this->user() && $this->user()->hasPermission('upload-themes');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||
|
|
*/
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'theme_zip' => 'required|file|mimes:zip|max:10240', // Max 10MB
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|