cms/app/Http/Requests/Admin/Themes/ThemeFileTreeRequest.php

34 lines
714 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\Admin\Themes;
use Illuminate\Foundation\Http\FormRequest;
/**
* Request for getting the theme file tree.
*/
class ThemeFileTreeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return $this->user()->hasPermission('edit-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' => 'required|string',
];
}
}