> For the complete documentation index, see [llms.txt](https://vladimirkostikov.gitbook.io/laraboom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vladimirkostikov.gitbook.io/laraboom/application-behavior/12-console-schedule.md).

# 12. Console and schedule

The single CLI entry point of a host is `php boom`. Under the hood it is Laravel Artisan. In front of it is `BoomKernel` with a human friendly help and aliases.

## Help

```bash
php boom
php boom help
```

The help sections. Resources, Schema, Seed, Database, App, Make.

## Aliases

| Short               | Actually           |
| ------------------- | ------------------ |
| `php boom key`      | `key:generate`     |
| `php boom discover` | `package:discover` |
| `php boom tinker`   | `shell`            |

## Command map

### Resources

```bash
php boom make {Name} [fields...] [--sync] [--force]
php boom make {Name} --type=resource|route|service|job|event|mail|notice
php boom resources
```

### Schema

```bash
php boom schema
php boom schema {resource}
php boom schema --check [--json]
php boom sync [resource] [--dry]
php boom sync:drop {resource} --force
php boom sync:prune [resource] --force
php boom rebuild --force [--seed|--fresh] [--dry]
php boom doctor
php boom openapi [--out=] [--json]
```

### Seed / DB

```bash
php boom seed [--fresh] [resource]
php boom seed --status
php boom migrate [--force] [--fresh] [--seed]
php boom install [--fresh]
```

### App runtime

```bash
php boom shell
php boom routes [--json]
php boom explain {resource}
php boom queue:work
php boom schedule:run
```

In Docker the `queue` and `schedule` services run separately (`queue:work`, `schedule:work`).

## Run. Your own commands on App

```php
#[Run('demo:pulse', about: 'Count active demo rows')]
public function pulse(): string
{
    $active = app(Demo::class)->query()->where('status', 'active')->count();
    $total = app(Demo::class)->query()->count();

    return "demos_active={$active} demos_total={$total}";
}
```

```bash
php boom demo:pulse
```

A method on `App\App` becomes an Artisan command. A returned string is printed to the console. That is how you add admin one shots without a `Command` class.

## Every. The schedule

The attribute signature:

```php
#[Every(string $freq = 'daily', ?string $at = null)]
```

Registration in `AppHooks`:

| Entry                            | Behavior                                  |
| -------------------------------- | ----------------------------------------- |
| `#[Every('hourly')]`             | `hourly()`                                |
| `#[Every('daily')]`              | `daily()`                                 |
| `#[Every('daily', at: '13:00')]` | `dailyAt('13:00')`                        |
| `#[Every('weekly')]`             | `weekly()`                                |
| `#[Every('0 * * * *')]`          | any other `$freq` goes into `cron($freq)` |

An example from apps:

```php
#[Every('hourly')]
public function pulseDemos(): void
{
    $active = app(Demo::class)->query()->where('status', 'active')->count();
    note('demo.hourly', ['active' => $active]);
}
```

`#[Every]` and `#[Run]` are looked up on `App` and on Resources (hooked owners). A method without arguments is called by the scheduler as a closure.

The scheduler has to actually run.

* In Docker that is the `schedule` service
* Otherwise a cron line `* * * * * cd /path/to/host && php boom schedule:run`

## Shell

```bash
php boom shell
php boom tinker --execute="echo 1"
```

An interactive shell with BoomCaster. Handy to call `app(Demo::class)->query()->count()` without HTTP.

## Queue

```bash
php boom queue:work --sleep=1 --tries=3
```

Jobs from `go([...])` with `#[Job]` land here. Without a worker the queue piles up in the database or in the driver.

## A typical developer day

```bash
php boom doctor
php boom sync
php boom seed demos
php boom routes
php boom explain demos
php boom demo:pulse
```

After pulling somebody else's Resource fields, run `sync` again and `schema --check` if needed.

Next up is [Seeds and generators](/laraboom/application-behavior/13-seeding-make.md).


---

# 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://vladimirkostikov.gitbook.io/laraboom/application-behavior/12-console-schedule.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.
