bale/core

Core for bale

Maintainers

Package info

github.com/papa-ree/core

Language:Blade

pkg:composer/bale/core

Statistics

Installs: 65

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-03-03 07:04 UTC

This package is auto-updated.

Last update: 2026-03-03 07:05:04 UTC


README

This package provides common logic for Bale CMS packages, including shared components, services, and tenant management.

Installation

composer require papa-ree/bale-core

You can publish and run the migrations with:

php artisan vendor:publish --tag="bale-core:migrations"
php artisan migrate

Analytics (Umami)

Bale Core provides a service and migration for integrating Umami Analytics (self-hosted).

Configuration

Add the following environment variables to your .env file:

UMAMI_URL=https://balystics.ponorogo.go.id
UMAMI_API_KEY=your-api-key-here
UMAMI_CACHE_TTL=300

Generate API Key: Dashboard Umami → Settings → API Keys → Create API Key

Table tenant_analytics

This table is located in the main database and defines which Umami website ID is linked to which Bale (tenant).

To connect a Bale to Umami, add a record to this table:

INSERT INTO tenant_analytics (id, bale_id, provider, website_id, domain, enabled)
VALUES (UUID(), '<bale_uuid>', 'umami', '<umami_website_uuid>', 'domain.com', 1);
  • bale_id: The UUID of the tenant in bale_lists.
  • website_id: The website UUID generated by your Umami instance.

UmamiService

This service handles authentication and fetches data from the Umami REST API.

  • All API results are cached in the tenant's database for a duration specified by UMAMI_CACHE_TTL.
  • Errors are logged automatically, returning null to ensure the application does not crash if the API is unreachable.

Shared Components

Chart Component

The x-core::chart component uses Chart.js to render various types of charts.

<x-core::chart
    type="line"
    :labels="['Jan', 'Feb', 'Mar']"
    :datasets="[
        [
            'label' => 'Visitors',
            'data' => [120, 150, 180],
            'borderColor' => '#3b82f6',
        ]
    ]"
/>

Credits

License

The MIT License (MIT).