bale / core
Core for bale
Requires
- php: ^8.2
- illuminate/contracts: ^11.0||^12.0
- josiasmontag/laravel-recaptchav3: *
- laravel/fortify: *
- laravel/socialite: *
- league/flysystem-aws-s3-v3: *
- mallardduck/blade-lucide-icons: *
- mcamara/laravel-localization: *
- rtconner/laravel-tagging: *
- socialiteproviders/keycloak: *
- spatie/laravel-permission: *
- yadahan/laravel-authentication-log: *
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
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 inbale_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
nullto 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).