skip to Main Content

I am using laravel pennant for feature flags, essentially only for reading if the features are enabled or not. Is there a way for pennant to not use the DB and store data in Features table? I want the feature flags to be computed on every request.

2

Answers


  1. If you want to disable caching for Laravel Eloquent queries, you can do so by turning off query caching using the disableQueryLog method. Here’s how you can use it:

    DB::connection()->disableQueryLog();
    

    Here it’s example:

    public function someControllerMethod()
    {
        // Disable query caching for this specific method
        DB::connection()->disableQueryLog();
    
        // Your Eloquent queries go here
        $results = YourModel::where('column', 'value')->get();
    }
    

    By calling DB::connection()->disableQueryLog(), you ensure that query caching is disabled for the specific block of code where you need it. This allows you to run queries without caching within that context.

    Login or Signup to reply.
  2. You can set PENNANT_STORE in your .env file to array to use in-memory storage.

    PENNANT_STORE=array
    

    You may need to run php artisan optimize for the change to take effect.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search