Files
aroginhealthcare/Modules/Page/app/Http/Requests/CreatePageRequest.php
2025-08-17 16:23:14 +05:45

37 lines
1.1 KiB
PHP

<?php
namespace Modules\Page\app\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreatePageRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'title' => 'required|string|max:255',
'slug' => 'required|string|unique:pages,slug|max:255',
'summary' => 'required|string',
'description' => 'sometimes|nullable|string',
'display_order' => 'sometimes|nullable|integer',
'status' => 'required|in:active,inactive',
'image' => 'sometimes|nullable|image|mimes:jpeg,png,jpg,gif|max:2048', // Adjust the image rules as needed
'meta_title' => 'sometimes|nullable|string|max:255',
'meta_description' => 'sometimes|nullable|string|max:255',
'meta_keywords' => 'sometimes|nullable|string|max:255',
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
// return auth()->user()->can('users.create');
}
}