PHPackages                             matthewbdaly/laravel-flatpages - 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. matthewbdaly/laravel-flatpages

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

matthewbdaly/laravel-flatpages
==============================

Laravel flat pages package. Inspired by Django's flatpages

1.2.2(8y ago)184MITPHP

Since Nov 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/matthewbdaly/laravel-flatpages)[ Packagist](https://packagist.org/packages/matthewbdaly/laravel-flatpages)[ RSS](/packages/matthewbdaly-laravel-flatpages/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (14)Used By (0)

laravel-flatpages
=================

[](#laravel-flatpages)

[![Build Status](https://camo.githubusercontent.com/fbeefd60324d050348fbd06fa72b983fdd997580b2a7625b1739b358056f8ec7/68747470733a2f2f7472617669732d63692e6f72672f6d6174746865776264616c792f6c61726176656c2d666c617470616765732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matthewbdaly/laravel-flatpages)[![Coverage Status](https://camo.githubusercontent.com/f8d8e505d4fc85b1d38f33696aafd12644041dcde59dccc1e46f7a8974b37ebe/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6174746865776264616c792f6c61726176656c2d666c617470616765732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/matthewbdaly/laravel-flatpages?branch=master)

A flatpages implementation for Laravel.

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

[](#installation)

```
$ composer require matthewbdaly/laravel-flatpages
```

Usage
-----

[](#usage)

This package includes not only a model and its associated repository and decorator, but also a controller and view for handling the request. However, it does not include a route - this is because ideally the route for the flat pages should be the very last one in your routes, since it can interfere with other routes. Unless all your flat pages will live under a certain route, you should make sure the route for this is the last one executed, otherwise you will have problems with it. Don't say I didn't warn you!

The controller lives at `Matthewbdaly\LaravelFlatpages\Http\Controllers\FlatpageController` and your route should call the `page()` method, with the path passed through as the single argument:

```
Route::get('{path}', '\Matthewbdaly\LaravelFlatpages\Http\Controllers\FlatpageController@page');
```

Alternatively, you can use the middleware at `Matthewbdaly\LaravelFlatpages\Http\Middleware\FlatpageMiddleware`, which may be more convenient. Be aware it will run on every 404 response received, and it should be set as the last global middleware.

Overriding the view
-------------------

[](#overriding-the-view)

The default view used is `flatpages::base`, but this almost certainly isn't what you want, so you'll need to create a new version in your project at `resources\views\vendor\flatpages\base`. Obviously this can extend or include other views in the usual manner.

Every flatpage object has a `template` field. This defaults to null, which will use `flatpages::base`, but you can set it to point at any other view you want to use. Your view will obviously need to use the same variables as the default one, but using this method you can create multiple views that can be used by one or more templates, meaning that part of the content can be kept in the view and part in the database. This makes the package more flexible in that you can choose which content users can manage themselves and which you can control.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~5 days

Total

13

Last Release

3043d ago

Major Versions

0.0.7 → 1.0.02017-12-12

### Community

Maintainers

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

---

Top Contributors

[![matthewbdaly](https://avatars.githubusercontent.com/u/450801?v=4)](https://github.com/matthewbdaly "matthewbdaly (54 commits)")

---

Tags

cmsflatpageslaravelpageslaravelcmspagesflatpages

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/matthewbdaly-laravel-flatpages/health.svg)

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

PHPackages © 2026

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