Following the Laravel docs, it says here that the batches table should be pruned daily by running the following.
$schedule->command('queue:prune-batches')->daily();
I've tried running this command on my server and I get the error:
Command "queue:prune-batches" is not defined.
I searched Google but I couldn't find any matching results for this error or many results for "queue:prune-batches" for that matter.
Am I missing something?
That command was added in Laravel 8.21.
You can determine your exact version installed by doing one of the following:
composer.lock
it should have the exact installed version in therecomposer show laravel/framework
the exact installed version should be in the first few lines of the outputvendor/laravel/framework/src/Illuminate/Foundation/Application.php
for the VERSION
constantdd(VERSION)
in any route to get the constant from (3) dumpedSince Laravel is using semver there's generally no harm running composer update
to update to the latest minor version and get all documented features.
Figuring this out is a rather complex process of searching the github repository for that command and finding this commit that added it. It lists all the tags that the commit was merged with and those start from v8.21.0