Skip to the content of this page

Getting started

Eloquentize counts what happens in your Laravel apps, such as users created or invoices issued, and shows it on one dashboard.

You install a small package, add one token, and schedule one command. You do not write any tracking code.

Before you start

You need:

  • A Laravel app. The package is tested on Laravel 10 to 13 with PHP 8.1 to 8.4. Older apps work too, down to Laravel 5.6 on PHP 7.4 (see step 1).
  • An Eloquentize account. Create one for free.
  • Timestamps on the tables you want to track. Each model needs created_at (or the date column you choose), and must use Laravel's timestamps.
  • A scheduler running on your server. This means one cron entry that runs php artisan schedule:run every minute. On Laravel Forge, turn on the scheduler option.

Shell access helps for the first test, but you do not need it afterwards: the scheduler runs everything.

Step 1: Install the package

Run this in your project:

composer require eloquentize/laravel-eloquentize-client

On PHP 7.4, install the dedicated branch instead:

composer require eloquentize/laravel-eloquentize-client dev-php7.4

Step 2: Add your API key

  1. Sign in to Eloquentize.
  2. Open Settings, then API Keys, and create a key.
  3. Copy it into your .env file:
ELOQUENTIZE_API_TOKEN=your_api_key_here

You can use the same key in several projects.

Step 3: Test without sending anything

Run the command with --dry and -v:

php artisan eloquentize:models-count --dry -v

--dry means nothing is sent. -v prints the details. You should see:

  • the app name Eloquentize will use, between asterisks;
  • the list of models it found.

If a model you expect is missing, see No models found.

Step 4: Send your first metrics

Run the same command without --dry:

php artisan eloquentize:models-count

This counts every model created today and sends the numbers to Eloquentize. Open your dashboard: your app and its metrics are created automatically. There is nothing to set up there first.

Step 5: Run it automatically

Add the command to your scheduler.

On Laravel 11 and later, edit routes/console.php:

use Illuminate\Support\Facades\Schedule;

Schedule::command('eloquentize:models-count')->hourly();

On Laravel 10 and earlier, edit app/Console/Kernel.php:

protected function schedule(Schedule $schedule): void
{
    $schedule->command('eloquentize:models-count')->hourly();
}

Running it every hour keeps today's numbers up to date. For other schedules, see Schedule your commands.

Already have data?

If your app has been running for a while, you can send its past days too, in one command. See Send your history.

Next steps

About the author

© Eloquentize 2024–2026

Social & Contact

Bluesky LinkedIn