PHPackages                             lnch/laravel-blog - 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. lnch/laravel-blog

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

lnch/laravel-blog
=================

A complete Blog module, with category, tag, and images

1.1.0(7y ago)4642PHP

Since May 4Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Laravel Blog
============

[](#laravel-blog)

This package has been designed for use with installations of **Laravel 5.4 and above.** It may well function perfectly well in previous versions but as of the time of writing these docs, it has not been tested and is not supported.

- [Installation](#installation)
- [Usage](#usage)
    - [Frontend Routes](#frontend-routes)
    - [Backend Routes](#backend-routes)
- [Policies](#policies)
- [Configuration](#configuration)
- [Events](#events)
- [Marking Posts per Site](#marking-posts-per-site)

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

[](#installation)

This package can be used in Laravel 5.4 or higher.

In Laravel 5.5 the service provider and facade will automatically get registered. In older versions of the framework just add the service provider and facade in `config/app.php` file:

```
'providers' => [
    // ...
    Lnch\LaravelBlog\LaravelBlogServiceProvider::class,
];
```

```
'aliases' => [
    // ...
    Lnch\LaravelBlog\LaravelBlogFacade::class
]
```

Once the package is installed, the database migrations must be run. You can optionally publish the migrations to your database/migrations directory if desired using the command below

```
php artisan vendor:publish --tag="laravel-blog/migrations"
```

To create the relevant DB tables for the blog, run the migrations like so:

```
php artisan migrate
```

For the blog to function properly, you must also publish the public assets provided. These will be published to the `public/vendor/lnch/laravel-blog` directory. Run the following command to publish the assets:

```
php artisan vendor:publish --tag="laravel-blog/public"
```

If you are using the provided layouts then you do not need to reference these public files after publishing them. If you are using a custom layout (explained below in the [config](#config) section), you will have to reference the CSS and JS files like so in your layout:

```

```

```

```

The package also makes use of jQuery so you will also need to reference this before the package JS file if you are using your own layouts.

Usage
-----

[](#usage)

After installation, a set of routes, controllers and views are provided to allow instant use of the package. All controllers referenced are namespaced to `Lnch\LaravelBlog\Controllers` The routes provided are as follows:

### Frontend Routes

[](#frontend-routes)

RouteFunctionalityController/blogDisplays all blog posts (frontend)BlogController@index/blog/{id}/{slug?}Displays an individual postBlogController@show### Backend Routes

[](#backend-routes)

All backend routes, excluding scheduled posts, are resource routes. Not all HTTP verbs are included with each resource controller. Excluded routes are noted below.

RouteFunctionalityControllerExcluded Verbs/admin/blog/postsAllows management of blog postsBlogPostController/admin/blog/posts/scheduledAllows management of scheduled blog postsBlogPostController@scheduled/admin/blog/tagsAllows management of tagsBlogTagControllercreate, show/admin/blog/categoriesAllows management of catgegoriesBlogCategoryControllershow/admin/blog/imagesAllows management of imagesBlogImageControllershowFor more in depth instruction in how to use the various features of the package, please read the documentation pages

Policies
--------

[](#policies)

A number of Policy classes are included, that by default will allow all actions to all users. If you would like to define your own Policy classes for the included models, a set of interfaces are provided to ensure your policies contain all necessary functionality.

Refer to the table below to see which interfaces you should implement for each model

ModelInterface\\Lnch\\LaravelBlog\\Models\\BlogPost\\Lnch\\LaravelBlog\\Contracts\\BlogPostPolicyInterface\\Lnch\\LaravelBlog\\Models\\BlogTag\\Lnch\\LaravelBlog\\Contracts\\BlogTagPolicyInterface\\Lnch\\LaravelBlog\\Models\\BlogCategory\\Lnch\\LaravelBlog\\Contracts\\BlogCategoryPolicyInterface\\Lnch\\LaravelBlog\\Models\\BlogImage\\Lnch\\LaravelBlog\\Contracts\\BlogImagePolicyInterfaceConfiguration
-------------

[](#configuration)

To modify the configuration of the package, you can publish the config file with the following command:

```
php artisan vendor:publish --tag="laravel-blog/config"
```

This will create a local copy of the configuration file for you to edit. That you can modify to suit your needs. The config file is commented to assist you in modifying the properties.

Events
------

[](#events)

A number of events are provided to allow you to hook your own custom functionality into the Blog process. The events, and their properties are listed below

EventPropertiesLnch\\LaravelBlog\\Events\\BlogPostCreated$post - The post that was createdLnch\\LaravelBlog\\Events\\BlogPostUpdated$post - The updated post
$oldPost - The post before it was updatedLnch\\LaravelBlog\\Events\\BlogPostDeleted$post - The post that was deletedMarking posts per Site
----------------------

[](#marking-posts-per-site)

If your project has a concept of multiple sites, and you want to restrict posts, tags, categories and images only to a certain site, the package is set up for that.

To being with, create a new class that implements `Lnch\LaravelBlog\Contracts\SiteInterface`. This contract only has one public static function, with the following signature;

```
public static function getSiteId();
```

Your model should use this function to define the ID of the Site you wish to link blog posts too at the time. The function should return either NULL or an integer to define the active site.

Once you have created your model, you will have to update two configuration properties as so:

```
    // ...

    'site_model' => Lnch\LaravelBlog\Models\Site::class,

    'site_primary_key' => 'id',
```

Update the `site_model` to the qualified class name of your site class, and if your Site model uses something other than `id` as it's primary key, change the `site_primary_key` property to represent this.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~347 days

Total

2

Last Release

2583d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38afa873ba17cb829601c1621c6482337f33fc72ee4004cc8fe24df004b761d6?d=identicon)[lnch](/maintainers/lnch)

---

Top Contributors

[![LNCH](https://avatars.githubusercontent.com/u/10821244?v=4)](https://github.com/LNCH "LNCH (160 commits)")[![abbasCoder51](https://avatars.githubusercontent.com/u/14301710?v=4)](https://github.com/abbasCoder51 "abbasCoder51 (6 commits)")[![williamconnell](https://avatars.githubusercontent.com/u/12997345?v=4)](https://github.com/williamconnell "williamconnell (1 commits)")

### Embed Badge

![Health badge](/badges/lnch-laravel-blog/health.svg)

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

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[ronasit/laravel-helpers

Provided helpers function and some helper class.

1475.7k13](/packages/ronasit-laravel-helpers)[inspiredminds/contao-fieldset-duplication

Contao extension to allow the duplication of form fieldsets in the front end by the user for additional input fields.

158.2k1](/packages/inspiredminds-contao-fieldset-duplication)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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