Digging Deeper
Suppression Hooks
Introduction
Basics
- Installation
- Make Model Filterable
- Filtering Models
- Allowing Filters
- Relationships
Available Filters
- Full Filter List
- Field Filters
- Relation Filters
- Morph Relation Filters
- Condition Filters
Digging Deeper
Digging Deeper
Suppression Hooks
Overview
You can hook into the suppression system if you want to perform some custom actions.
Example
use IndexZer0\EloquentFiltering\Suppression\Suppression;
Suppression::handleDeniedFilterUsing(function (SuppressibleException $se): void {
Log::channel('slack')->info('Bug in frontend client, trying to use filter type that is not allowed: ' . $se->getMessage());
throw new FrontendBugException($se->getMessage());
});
Available Suppression Hooks.
// All
Suppression::handleAllUsing();
// Filter
Suppression::handleFilterUsing();
Suppression::handleInvalidFilterUsing();
Suppression::handleMissingFilterUsing();
Suppression::handleMalformedFilterUsing();
Suppression::handleDeniedFilterUsing();
// Sort
Suppression::handleSortUsing();
Suppression::handleMalformedSortUsing();
Suppression::handleDeniedSortUsing();
On this page