PHPackages                             ameax/content-container-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. [Framework](/categories/framework)
4. /
5. ameax/content-container-core

ActiveLibrary[Framework](/categories/framework)

ameax/content-container-core
============================

A flexible, framework-agnostic content container system for Laravel applications with support for multiple container types, layouts, scheduling, and multi-tenant context filtering.

018[2 PRs](https://github.com/ameax/content-container-core/pulls)PHPCI passing

Since Jan 10Pushed 1mo agoCompare

[ Source](https://github.com/ameax/content-container-core)[ Packagist](https://packagist.org/packages/ameax/content-container-core)[ RSS](/packages/ameax-content-container-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Content Container Core
======================

[](#content-container-core)

[![Latest Version on Packagist](https://camo.githubusercontent.com/01aa5b75aeea71ee3e4258aa491aa698e44c6ad9e830dde990cbe9bc75d2979d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d6561782f636f6e74656e742d636f6e7461696e65722d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ameax/content-container-core)[![GitHub Tests Action Status](https://camo.githubusercontent.com/44742725f8a6427ab24832267e5dd2a337101d659481b1daed686105f554a2a6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d6561782f636f6e74656e742d636f6e7461696e65722d636f72652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ameax/content-container-core/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/06c70a57a05805f0dff447a94fcb4696da55fa73cb9c8983d70d9175fa1b5afe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d6561782f636f6e74656e742d636f6e7461696e65722d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ameax/content-container-core)

A flexible, framework-agnostic content container system for Laravel applications. This package provides the core infrastructure for building modular content management systems with support for multiple container types, layouts, scheduling, and multi-tenant context filtering.

Features
--------

[](#features)

- **Polymorphic Containers**: Attach containers to any Eloquent model (pages, products, categories, etc.)
- **Flexible Type System**: Define custom container types with their own data structures and layouts
- **Layout Support**: Multiple visual layouts per container type
- **Visibility Scheduling**: Show containers based on fixed dates or recurring schedules
- **Context Filtering**: Multi-tenant support with customizable context scoping
- **View Resolution**: Theme-aware view resolution with fallback support
- **URL Resolution**: Abstract URL resolution for internal references

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

[](#installation)

Install the package via Composer:

```
composer require ameax/content-container-core
```

Publish the config file:

```
php artisan vendor:publish --tag="content-container-core-config"
```

### Database Setup

[](#database-setup)

This package provides migration stubs that you can use as a reference. Copy them to your project and customize as needed:

```
# The stubs are located in:
# vendor/ameax/content-container-core/database/migrations/create_containers_table.php.stub
# vendor/ameax/content-container-core/database/migrations/create_container_references_table.php.stub
```

Or create your own migrations based on the schema requirements below.

Configuration
-------------

[](#configuration)

```
// config/content-container-core.php
return [
    'models' => [
        'container' => \App\Models\Container::class,
        'container_reference' => \App\Models\ContainerReference::class,
    ],

    'resolvers' => [
        'view' => \App\Services\MyViewResolver::class,
        'url' => \App\Services\MyUrlResolver::class,
        'context_filter' => \App\Services\MyContextFilter::class,
    ],

    'tables' => [
        'containers' => 'containers',
        'container_references' => 'container_references',
    ],
];
```

Usage
-----

[](#usage)

### 1. Create Your Container Model

[](#1-create-your-container-model)

Extend the base container model with your project-specific implementation:

```
