PHPackages                             bale/emperan - 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. bale/emperan

ActiveLibrary

bale/emperan
============

Bale Landing Page Backend

045PHP

Since Mar 30Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Bale Landing Page Backend
=========================

[](#bale-landing-page-backend)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1593b85563c6bd36317064ed9a9204f628dd3afb9e3a6c8e9c66b9313d665698/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616c652f656d706572616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bale/emperan)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b8b4d4a536dfe41398e90f922a5009ae47ecf95574ffb4200436edde60d91b51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62616c652f656d706572616e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/bale/emperan/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f913e7bcc9bacec5fe81751fd3c1b3a9d888d2e31f524365b438aed047e98f65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62616c652f656d706572616e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/bale/emperan/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/22258378072aca5958b8f101cb75590a894030ef76070114390af9dcdd7c9083/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616c652f656d706572616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bale/emperan)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/d4706aad1ab825a701d93d7185d6966a112bbe5e75ed52f9d6c5b34dca4b3d75/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f62616c652d656d706572616e2e6a70673f743d31)](https://spatie.be/github-ad-click/bale-emperan)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

Anda dapat menginstal paket ini melalui composer:

```
composer require bale/emperan
```

Setelah paket terinstal, jalankan perintah instalasi untuk mempublikasikan konfigurasi, menjalankan migrasi, dan melakukan seeding data awal:

```
# Instalasi standar (membuat section default: hero, post, footer)
php artisan emperan:install

# Instalasi dengan nama section kustom (misal: hero-nama_organisasi-section, dst)
php artisan emperan:install nama_organisasi
```

Perintah di atas akan otomatis melakukan:

1. Publish konfigurasi `emperan:config`.
2. Seeding data `Section` dengan struktur JSON `content` (meta &amp; items).

Jika Anda ingin menjalankan langkah-langkah secara manual:

```
# Publish migrasi
php artisan vendor:publish --tag="emperan:migrations"

# Jalankan migrasi
php artisan migrate

# Publish config
php artisan vendor:publish --tag="emperan:config"
php artisan vendor:publish --tag="emperan:landing-page"
```

Usage
-----

[](#usage)

### SEO Meta Tags

[](#seo-meta-tags)

Model apapun dapat mendukung SEO dengan menggunakan trait `HasSeoMeta`:

```
use Bale\Emperan\Traits\HasSeoMeta;

class YourModel extends Model
{
    use HasSeoMeta;
}
```

Model bawaan yang sudah mendukung SEO:

- `Post` - untuk artikel/berita
- `Page` - untuk halaman statis
- `Section` - untuk section landing page

### Menggunakan SEO Component di Blade

[](#menggunakan-seo-component-di-blade)

Gunakan component `` di layout Blade Anda:

```

    {{-- Dengan model --}}

    {{-- Dengan fallback defaults --}}

```

Component akan otomatis render:

- Title dan meta description
- Open Graph tags (Facebook)
- Twitter Card tags
- Canonical URL
- Robots meta (noindex/nofollow)
- JSON-LD structured data

### Menyimpan SEO Meta ke Database

[](#menyimpan-seo-meta-ke-database)

```
// Create/update SEO meta
$post->updateSeoMeta([
    'title' => 'Custom SEO Title',
    'description' => 'Custom meta description for search engines',
    'keywords' => 'keyword1, keyword2, keyword3',
    'og_title' => 'Custom Open Graph Title',
    'og_description' => 'Description for social media',
    'og_image' => 'https://example.com/og-image.jpg',
    'canonical_url' => 'https://example.com/canonical',
    'no_index' => false,
    'no_follow' => false,
]);

// Akses SEO data
$post->getSeoTitle();
$post->getSeoDescription();
$post->getOgImage();
$post->getSeoKeywords();
```

### Sitemap XML

[](#sitemap-xml)

Sitemap otomatis diakses di:

- `/sitemap.xml` - Sitemap index
- `/sitemap-posts.xml` - Sitemap untuk posts
- `/sitemap-pages.xml` - Sitemap untuk pages

Sitemap akan otomatis mengambil data dari database dengan:

- `lastmod` dari `updated_at`
- `changefreq` dan `priority` yang optimal
- Image sitemap extension untuk thumbnail

### Robots.txt

[](#robotstxt)

Robots.txt dinamis diakses di `/robots.txt` dengan:

- Allow semua crawler
- Disallow admin, API, dan auth paths
- Sitemap URL otomatis

### Menambahkan SEO ke Model Custom

[](#menambahkan-seo-ke-model-custom)

Untuk menambahkan SEO ke model custom Anda:

```
// 1. Tambahkan trait ke model
use Bale\Emperan\Traits\HasSeoMeta;

class Event extends Model
{
    use HasSeoMeta;

    // Model harus punya 'title' untuk fallback default
}

// 2. (Opsional) Tambahkan ke sitemap dengan extend SitemapController
```

### CDN Support

[](#cdn-support)

Package ini menyediakan integrasi CDN untuk mempercepat loading asset statis.

#### Konfigurasi

[](#konfigurasi)

Tambahkan variabel berikut di file `.env` Anda:

```
EMPERAN_CDN_ENABLED=true
EMPERAN_CDN_URL=https://cdn.bale.co.id
EMPERAN_CDN_PREFIX=bale
```

#### Helper Functions

[](#helper-functions)

Tersedia helper global untuk memudahkan akses asset via CDN:

- `cdn_asset(string $path)`: Generate full URL ke asset di CDN.
- `cdn_url(string $path)`: Alias dari `cdn_asset()`.
- `cdn_enabled()`: Mengecek apakah CDN sedang aktif.

#### Logic Path CDN

[](#logic-path-cdn)

URL yang dihasilkan mengikuti format: `{EMPERAN_CDN_URL}/{EMPERAN_CDN_PREFIX}/{slug_organisasi}/{path}`

**Pengecualian:**Jika path diawali dengan `shared/`, maka `{slug_organisasi}` akan dihilangkan dari URL. Contoh: `cdn_asset('shared/logo.png')` -&gt; `https://cdn.bale.co.id/bale/shared/logo.png`

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance59

Moderate activity, may be stable

Popularity10

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 (27 commits)")

### Embed Badge

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

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

PHPackages © 2026

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