PHPackages                             bale/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bale/core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bale/core
=========

Core for bale

0219Blade

Since Jun 12Pushed 3w agoCompare

[ Source](https://github.com/papa-ree/core)[ Packagist](https://packagist.org/packages/bale/core)[ RSS](/packages/bale-core/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Core package for Bale CMS
=========================

[](#core-package-for-bale-cms)

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

Installation
------------

[](#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
```

### Migration Publisher (Recommended)

[](#migration-publisher-recommended)

Alternatively, you can use the interactive migration publisher which provides more control:

```
php artisan core:publish-migration
```

This command allows you to:

- **All**: Publish all migrations.
- **Auto (Only missing)**: Publish only migrations that don't exist yet in your application.
- **Specific Migration**: Select specific migrations from a list.

### Error Views Publisher

[](#error-views-publisher)

You can publish the custom error views to your application:

```
php artisan core:publish-error
```

To overwrite existing files, use the `--force` flag:

```
php artisan core:publish-error --force
```

Analytics (Umami)
-----------------

[](#analytics-umami)

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

### Configuration

[](#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`

[](#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(), '', 'umami', '', 'domain.com', 1);
```

- `bale_id`: The UUID of the tenant in `bale_lists`.
- `website_id`: The website UUID generated by your Umami instance.

### `UmamiService`

[](#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
-----------------

[](#shared-components)

### Chart Component

[](#chart-component)

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

```

```

### Upload Zone Component

[](#upload-zone-component)

The `x-core::upload-zone` is a pure Alpine.js + Livewire drag-and-drop file upload component. It does not depend on FilePond and follows the Bale design system.

#### Features

[](#features)

- **Drag-and-Drop**: Visual feedback when dragging files over the zone.
- **Multiple Upload**: Support for selecting and uploading multiple files simultaneously.
- **Client-side Validation**: Instant checks for file type and size before uploading.
- **Image Preview**: Displays a thumbnail grid for image files.
- **File Info**: Shows filename, size, and upload progress status for each file.
- **Livewire Integration**: Built-in support for `$wire.upload()` with individual progress bars.
- **Dark Mode**: Fully styled for both light and dark themes.

#### Usage

[](#usage)

In your Livewire component, ensure you use the `WithFileUploads` trait and define the property:

```
use Livewire\WithFileUploads;

class MyComponent extends Component {
    use WithFileUploads;

    public $myFiles = []; // For multiple="true"
    // OR
    public $myFile;       // For multiple="false"
}
```

Then in your Blade view:

```

```

#### Supported Data Types

[](#supported-data-types)

The component binds to your Livewire property using `wire:model`. The data type of the property depends on the `multiple` attribute:

Mode`multiple`Data Type in LivewireDescription**Single**`false``TemporaryUploadedFile`A single file instance.**Multiple**`true``array`A collection of file instances.Note

All files are uploaded as instances of `Livewire\Features\SupportFileUploads\TemporaryUploadedFile`. You must handle the persistence logic in your component's `updated` hook or submit method.

#### Properties

[](#properties)

PropertyTypeDefaultDescription`wire:model``string`**required**The Livewire property name to bind the upload.`multiple``boolean``false`Whether to allow multiple file selection and upload.`accept``string``image/*`Comma-separated list of allowed MIME types or wildcards.`maxSize``int``512`Maximum file size allowed in Kilobytes (KB).`label``string``null`Main helper text displayed inside the drop zone.`hint``string``null`Sub-label text (e.g., "Max 512KB", "Formats: PNG, JPG").`class``string``''`Custom CSS classes for the component container.Credits
-------

[](#credits)

- [Papa Ree](https://github.com/papa-ree)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT).

```

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance62

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a4dff95fb8ef6beb3956487f0421a9229b3ded20f76917e49a1e7c2004267e4?d=identicon)[papa-ree](/maintainers/papa-ree)

---

Top Contributors

[![papa-ree](https://avatars.githubusercontent.com/u/79291092?v=4)](https://github.com/papa-ree "papa-ree (79 commits)")

### Embed Badge

![Health badge](/badges/bale-core/health.svg)

```
[![Health](https://phpackages.com/badges/bale-core/health.svg)](https://phpackages.com/packages/bale-core)
```

###  Alternatives

[wwwision/dcb-eventstore

Implementation of the Dynamic Consistency Boundary pattern described by Sara Pellegrini

2136.8k12](/packages/wwwision-dcb-eventstore)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
