PHPackages                             jobmetric/laravel-layout - 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. jobmetric/laravel-layout

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

jobmetric/laravel-layout
========================

This is a section management package for Laravel that you can use in your projects.

2.0.0(1mo ago)5342MITPHPPHP &gt;=8.0.1CI passing

Since Jun 29Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/jobmetric/laravel-layout)[ Packagist](https://packagist.org/packages/jobmetric/laravel-layout)[ Docs](https://jobmetric.github.io/packages/laravel-layout)[ RSS](/packages/jobmetric-laravel-layout/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (11)Versions (5)Used By (2)

[![Contributors](https://camo.githubusercontent.com/80d3c616bbd865b73655dd548b6bae5433662eaaece9bfbb57554eddd07eb472/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6a6f626d65747269632f6c61726176656c2d6c61796f75742e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-layout/graphs/contributors)[![Forks](https://camo.githubusercontent.com/b04f3ad90910349c93471eed477a5e03d5ec2d725e0a9c61fde98efaa1ef9e5d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6a6f626d65747269632f6c61726176656c2d6c61796f75742e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d466f726b)](https://github.com/jobmetric/laravel-layout/network/members)[![Stargazers](https://camo.githubusercontent.com/0bf4f3892c422c9db7cdbcfb2dbbf9c849d1d3302e22d99b3ee38e067a176369/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f626d65747269632f6c61726176656c2d6c61796f75742e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-layout/stargazers)[![MIT License](https://camo.githubusercontent.com/b6b38528c6bedd25db9f8500c742d70e00d2ca20ead89fde6770afb0241ada39/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f626d65747269632f6c61726176656c2d6c61796f75742e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-layout/blob/master/LICENCE.md)[![LinkedIn](https://camo.githubusercontent.com/eb590f47a3fca74584d18db8dd3e985ae3d786f50cd41b7530c3af3885da233c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/majidmohammadian)

Laravel Layout
==============

[](#laravel-layout)

**Define Layouts Once. Use Everywhere.**

Laravel Layout simplifies the management of page structures and layouts within Laravel applications. Stop duplicating layout logic across controllers and views and start building consistent, reusable layouts with ease. It offers layout definition, binding to applications and pages, plugin positioning, and seamless integration with your models through the `HasLayout` trait. This is where powerful layout management meets developer-friendly simplicity—giving you complete control over how layouts are assigned and resolved without the complexity.

Why Laravel Layout?
-------------------

[](#why-laravel-layout)

### One Source of Truth

[](#one-source-of-truth)

Define layouts once with name, status, and plugin assignments. Reuse the same layout across multiple applications (e.g. shop, cms) and pages (e.g. product, category), or attach it to specific models for fine-grained control. No more scattering layout logic—centralize it in one place.

### Application-Aware and Extensible

[](#application-aware-and-extensible)

Register your applications (shop, cms, admin, etc.) with optional names, descriptions, and default layouts. Bind layouts to application/page pairs or to models via a polymorphic relation. Integrate with Laravel Extension so each layout can specify which plugins appear in which positions. This flexibility ensures your layout system adapts to your application structure.

### Built for Performance

[](#built-for-performance)

Resolve layout for a model with optional caching (per-minute TTL or forever). Use query scopes to filter models that have a layout for a given application. Events let you react to layout store, update, delete, and relation changes without coupling. Perfect for high-traffic applications where layout resolution must stay fast.

### Simple Model Integration

[](#simple-model-integration)

Attach layouts to any Eloquent model through the `HasLayout` trait. Store one layout per application and optional collection, sync multiple layouts for an application, and fall back to a default or to the layout defined for the application/page. Your models become layout-aware with minimal configuration.

What is Layout Management?
--------------------------

[](#what-is-layout-management)

Layout management is the process of defining, binding, and resolving which layout is used for a given context. In a traditional Laravel application, you might hardcode layout choices in controllers or repeat the same logic in many places. Laravel Layout takes a different approach:

- **Database-Driven**: Layouts are stored in the database with name and status; they can be bound to application/page pairs and to models via relations
- **Application &amp; Page Binding**: Each layout can be associated with one or more application and page combinations (e.g. shop + product page)
- **Plugin Positioning**: Layouts link to extension plugins with position and ordering, so you control where and in what order extensions appear
- **Per-Model Assignment**: Through the `HasLayout` trait, any model can have a layout assigned per application and optional collection, with optional caching and fallbacks

Consider a product that needs a custom layout in the shop application. With Laravel Layout, you can define a "Main" layout with plugins in header and footer, register the "shop" application, bind that layout to the shop product page as a default, and attach a different layout to a specific product via `storeLayout`. The appropriate layout is resolved for that product (or falls back to the application/page or default), with optional caching. The power of layout management lies not only in defining layouts once but also in resolving them consistently for every context—global, per-page, or per-model—throughout your application.

What Awaits You?
----------------

[](#what-awaits-you)

By adopting Laravel Layout, you will:

- **Centralize layout logic** - Define layouts, pages, and plugin positions in one place instead of scattering them across controllers and configs
- **Reuse layouts across applications** - Same layout can serve shop, cms, or admin with different application keys and optional default layouts
- **Attach layouts to any model** - Use the `HasLayout` trait to assign layouts per application/collection, with optional caching and events
- **Stay in control** - Validation rules, API resources, and domain events keep your code consistent and auditable
- **Scale without duplication** - Cache resolved layouts, use registries for applications, and keep migrations and models aligned with Laravel conventions
- **Integrate with extensions** - Position plugins per layout so each page or model can have its own set of extensions in header, footer, or custom positions

Quick Start
-----------

[](#quick-start)

Install Laravel Layout via Composer:

```
composer require jobmetric/laravel-layout
```

Documentation
-------------

[](#documentation)

Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Layout:

**[📚 Read Full Documentation →](https://jobmetric.github.io/packages/laravel-layout/)**

The documentation includes:

- **Getting Started** - Quick introduction and installation guide
- **ApplicationRegistry** - Register applications with key, name, description, order, and default layout
- **Layout Service** - CRUD, getApplications, getApplicationsWithOptions, getPosition
- **HasLayout** - Integrate layouts into your models (storeLayout, getLayout, forgetLayout, scopes, caching, fallbacks)
- **Models** - Layout, LayoutPage, LayoutPlugin, LayoutRelation
- **Requests &amp; Resources** - StoreLayoutRequest, UpdateLayoutRequest, API resources
- **Rules &amp; Exceptions** - CheckExistNameRule, ApplicationNotRegisteredException, CollectionPropertyNotExistException
- **Events** - Hook into layout lifecycle and HasLayout relation events
- **Real-World Examples** - See how it works in practice

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

[](#contributing)

Thank you for participating in `laravel-layout`. A contribution guide can be found [here](CONTRIBUTING.md).

License
-------

[](#license)

The `laravel-layout` is open-sourced software licensed under the MIT license. See [License File](LICENCE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance88

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% 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.

###  Release Activity

Cadence

Every ~207 days

Total

4

Last Release

59d ago

Major Versions

1.2.0 → 2.0.02026-03-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00d08bd4b0b765ee2d33719a535e6cb49c04fb945078a0809d5c05e6f16ee96?d=identicon)[majidmohammadian](/maintainers/majidmohammadian)

---

Top Contributors

[![MajidMohammadian](https://avatars.githubusercontent.com/u/2099965?v=4)](https://github.com/MajidMohammadian "MajidMohammadian (69 commits)")[![Bagheri-Matin](https://avatars.githubusercontent.com/u/239607447?v=4)](https://github.com/Bagheri-Matin "Bagheri-Matin (2 commits)")[![hassan7303](https://avatars.githubusercontent.com/u/128932029?v=4)](https://github.com/hassan7303 "hassan7303 (1 commits)")

---

Tags

laravellaravel-packagelayoutlayout-managementlayoutspackagepluginlaravelpackagelayoutmanagementsectionjobmetric

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jobmetric-laravel-layout/health.svg)

```
[![Health](https://phpackages.com/badges/jobmetric-laravel-layout/health.svg)](https://phpackages.com/packages/jobmetric-laravel-layout)
```

###  Alternatives

[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[cybercog/laravel-paket

Composer personal web interface. Manage Laravel dependencies without switching to command line!

1753.3k](/packages/cybercog-laravel-paket)

PHPackages © 2026

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