Setting Up Filterable
About 230 wordsLess than 1 minute
Purpose
The filterable:setup command initializes the Filterable package in your application. It publishes the package’s configuration file and ensures that the required directory structure (for filters) exists. This command is typically the first step after installing the package.
Usage
php artisan filterable:setupOptions
| Option | Description | Example |
|---|---|---|
--force | Overwrite the existing configuration file if it already exists. | php artisan filterable:setup --force |
What It Does
When executed, this command will:
Publish Configuration File It runs:
php artisan vendor:publish --tag=filterable-configand places the configuration file in:
config/filterable.phpEnsure Directory Structure Exists It creates:
app/Http/Filtersif it doesn’t already exist, ensuring you have a proper place to store your custom filters.
Provide Next Steps After setup, it suggests how to create your first filter:
php artisan filterable:make-filter PostFilter --filters=author,title
Example Output
🚀 Setting up Filterable package...
✅ Configuration file published: config/filterable.php
📁 Created directory: app/Http/Filters
🎉 Setup complete! You can now create your first filter with:
php artisan filterable:make PostFilter --filters=testNotes
- Use the
--forceflag if you want to re-publish the configuration file and overwrite existing settings. - The command automatically detects whether the
app/Http/Filtersdirectory already exists.
When to Use
- Right after installing the
kettasoft/filterablepackage. - When upgrading to a version that changes configuration defaults.
- When resetting your configuration to a clean state.
