> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/oss/laravel-scout-advanced-meilisearch/commands.md).

# Commands

This package adds more commands to Laravel to manage Meilisearch search engine stuff

### Attributes index settings

For sending filterable, sortable and displayable attributes to your Meilisearch server, configure your already searchable models using the methods or the PHP attribute from [Index settings](/oss/laravel-scout-advanced-meilisearch/index-settings.md).

Then run the following command:

```bash
php artisan scout:update "App\Models\User"
```

You could also run this command with `--wait` option which tells the command to wait for the task to finish:

```bash
php artisan scout:update "App\Models\User" --wait
```

### Dumps

Create Meilisearch data dumps (data backups that will be saved on your Meilisearch server), with the following command:

```bash
php artisan scout:dump
```

As `scout:update` command, this also have a `--wait` option:

```bash
php artisan scout:dump --wait
```

[Read more about Meilisearch dumps here](https://docs.meilisearch.com/learn/advanced/dumps.html).

### Tasks

List all tasks via command line, just running the following:

```bash
php artisan scout:tasks
```

**They can be even filtered!** (see more options running it with `--help`)

```bash
php artisan scout:tasks --status=succeeded
```

#### Canceling enqueued tasks

Also can cancel tasks with a very simple command, you can either cancel an specific task or multiple:

```bash
php artisan scout:tasks-cancel 1
```

The previous command will cancel task with UID = 1. If you wish to cancel multiple you could send them separated by comma or using options like:

```bash
php artisan scout:tasks-cancel --before-enqueued=1d
```

So this will cancel all tasks that were enqueued before 1 day (can also send 1m, 1y... **as in the background this is using `Carbon::now()->add()` & `Carbon::now()->sub()` methods**)

#### Prune finished tasks

As canceling tasks won't make them disappear from the tasks history, you can just run the following:

```bash
php artisan scout:tasks-prune
```

Just for safety for debug purposes, **this command does not remove those tasks that failed**, if you wish to do so, run the command with `--include-failed` like so:

```bash
php artisan scout:tasks-prune --include-failed
```

**Don't worry, this will not remove tasks that were enqueued and not finished, as stated by Meilisearch official docs (see link just below).**

[Read more about Meilisearch tasks here](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html#task-workflow).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.opensoutheners.com/oss/laravel-scout-advanced-meilisearch/commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
