⚡
Laravel Haystack
View Code On GithubEdit Docs
  • 🎯Getting Started
    • Introduction
    • How It Works
    • Installation
    • Usage
    • Configuration
    • Callback Events
  • 🛰️Cool Features
    • Shared Data
    • Shared Models
    • Long Delays & Pauses
    • Appending & Prepending Jobs
    • Chunking Jobs
  • 🗺️Next Up
    • Allowing Failed Jobs
    • Global Middleware
    • Connection, Queue & Delay
    • Naming Haystacks
    • Before Saving Hook
    • Custom Options
  • 🧼Cleanup
    • Deleting Stale Haystacks
    • Deleting Specific Haystacks
    • Clearing All Haystacks
  • 🛣️Finish
    • Support
    • Star On Github
    • Edit Documentation
Powered by GitBook
On this page
  1. Cleanup

Deleting Stale Haystacks

Laravel Haystack will attempt to clean up every job on successful/failed haystacks, however there may be a situation, especially if you have not enabled the automatic processing. If you have disabled the option to automatically delete haystacks when they are finished they may build up quickly.

You can prevent this by running the following prune command every day in your scheduler:

<?php

// Add to Console/Kernel.php

use Sammyjo20\LaravelHaystack\Models\Haystack;

$schedule->command('model:prune', [
    '--model' => [Haystack::class],
])->daily();
PreviousCustom OptionsNextDeleting Specific Haystacks

Last updated 2 years ago

🧼