Skip to the content of this page

Troubleshooting

Run your command again with -v. It prints what it does, and it explains why a model is skipped.

Nothing appears on my dashboard

Check these four things, in this order:

  1. The command ran. Run it by hand with -v and read the output.
  2. The key is set. ELOQUENTIZE_API_TOKEN must be in your .env file. After changing .env on a server that caches its config, run php artisan config:clear.
  3. You are looking at the right app. Run the command with --dry: it prints the app name Eloquentize will use, made of APP_URL and APP_ENV. If you changed one of them, your data went to a new source.
  4. The scheduler runs. Your server needs a cron entry that runs php artisan schedule:run every minute.

No models found

The command found no model files. By default it reads app/Models, or app if that folder does not exist, and only looks at files directly in it. If your models are somewhere else, see Models in another folder.

A model is skipped

With -v, the command says why. The two common reasons:

  • "does not use timestamps": the model has public $timestamps = false. Eloquentize needs timestamps.
  • "does not have a column named ...": the table has no column for the event you asked for. Check the name given to --event.

Table not found

If a model is a pivot, Laravel guesses its table name, and the guess can be wrong. Eloquentize then looks for a table that does not exist (for example user_widgets). Set the table on the model:

class UserWidget extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'user_widget';
}

Invalid date format

The day must match the date format. The default format is DD/MM/YYYY, for example 31/01/2024. If you write dates another way, pass the format with --dateFormat, using PHP date letters:

php artisan eloquentize:models-count 2024-01-31 --dateFormat="Y-m-d"

"scope option requires --models"

models-count needs to know which model owns the scope. Add --models=YourModel. In the same way, --scopeValue needs --scope.

"is not a valid aggregation type"

The aggregation must be min, max, avg or sum.

Command not found

Run php artisan list eloquentize. If no command appears, register them yourself in app/Console/Kernel.php:

protected $commands = [
    \Eloquentize\LaravelClient\Commands\ModelsCount::class,
    \Eloquentize\LaravelClient\Commands\PropertyAggregate::class,
    \Eloquentize\LaravelClient\Commands\ModelsCountLegacy::class,
];

Still stuck?

Open the live chat at the bottom of any page, or book a call.

About the author

© Eloquentize 2024–2026

Social & Contact

Bluesky LinkedIn