> For the complete documentation index, see [llms.txt](https://docs.laravel-haystack.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.laravel-haystack.dev/next-up/naming-haystacks.md).

# Naming Haystacks

You may wish to give your haystack a custom name. This is especially useful for debugging, as you could check your database and see what haystacks are currently being processed. To give the haystack a name, use the `withName` method when building the haystack.

```php
<?php

$haystack = Haystack::build()
   ->withName('Process API Data')
   ->addJob(new RetrieveDataFromApi)
   ->addJob(new ProcessDataFromApi)
   ->addJob(new StoreDataFromApi)
```
