'required|string|max:255', 'slug' => 'sometimes|required|string|max:255|unique:pages,slug,' . Page::where('uuid', request('uuid'))->first()->id, // Exclude the current page by ID 'summary' => 'sometimes|nullable|string', 'description' => 'sometimes|nullable|string', 'display_order' => 'sometimes|nullable|integer', 'code' => 'sometimes|nullable|string', 'status' => 'sometimes|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'); } public function messages() { return [ 'slug.unique' => 'The slug is already in use by another page.', // Add custom error messages for other rules as needed ]; } }