FilterableFilterable
Home
๐Ÿ“ฆ Installation
  • Setting Up Filterable
  • Discover Command
  • Listing All Filters
  • Testing Filters
  • Inspecting Filterable Classes
  • Caching
GitHub
Home
๐Ÿ“ฆ Installation
  • Setting Up Filterable
  • Discover Command
  • Listing All Filters
  • Testing Filters
  • Inspecting Filterable Classes
  • Caching
GitHub
  • Home
  • Introduction
  • Installation
  • Service Provider
  • How It Works
  • Engines

    • Invokable
    • Tree
    • Ruleset
    • Expression
  • Features

    • Lifecycle Hooks
    • Header-Driven Filter Mode
    • Auto Register Filterable Macro
    • Conditional Logic
    • Filter Aliases
    • Through callbacks
    • Auto Binding
    • Custom engines
    • Data Provisioning
  • Execution

    • Invoker
  • API Reference

    • Filterable
    • Filterable facade
    • Payload
    • Sorter
  • Caching

    • Overview
    • Getting Started
    • Strategies
    • Auto Invalidation
    • Cache Profiles
    • Scoping Cache
    • Monitoring Cached Items
    • API Reference
    • Examples
  • CLI

    • Setup Filterable
    • Discover Filters
    • Test Filter
    • List Filters
    • Inspect Filter
  • Exceptions
  • Event System
  • Profile Management
  • Profiler
  • Sorting
  • Authorization
  • Validation
  • Sanitization

Setting Up Filterable

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:setup

Options

OptionDescriptionExample
--forceOverwrite the existing configuration file if it already exists.php artisan filterable:setup --force

What It Does

When executed, this command will:

  1. Publish Configuration File It runs:

    php artisan vendor:publish --tag=filterable-config
    

    and places the configuration file in:

    config/filterable.php
    
  2. Ensure Directory Structure Exists It creates:

    app/Http/Filters
    

    if it doesnโ€™t already exist, ensuring you have a proper place to store your custom filters.

  3. 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=test

Notes

  • Use the --force flag if you want to re-publish the configuration file and overwrite existing settings.
  • The command automatically detects whether the app/Http/Filters directory already exists.

When to Use

  • Right after installing the kettasoft/filterable package.
  • When upgrading to a version that changes configuration defaults.
  • When resetting your configuration to a clean state.
Edit this page
Last Updated:
Contributors: kettasoft
Next
Discover Filters