webinfinita/blog

Simple blog for laravel 5
15
Install
composer require webinfinita/blog
Latest Version:0.0.2
PHP:>=5.4.0
Laravel:5
License:MIT
Last Updated:Apr 16, 2015
Links: GitHub  ·  Packagist
Maintainer: webinfinita

Webinfinita Simple Blog for Laravel 5 (BETA)

Note: Don't use this package just yet. Work in progress.


This is a simple blog package for laravel 5, the goal is to provide a starting point to a scalable blog post.

Installation

First we need to install it through composer

composer require "webinfinita/blog"

Then we need to add the service provider

// config/app.php

<?php

return [
	...
	...
	'providers' => [
		...
		...
        'Webinfinita\Blog\Providers\BlogServiceProvider',
    ],
];

Publish the migration and views

php artisan vendor:publish

We use a Trait to make a User have many Posts

// app/User.php

<?php namespace App;

...
use Webinfinita\Blog\Traits\HasManyPosts;

class User extends Model implements ... {

	use Authenticatable, CanResetPassword, HasManyPosts;
	...

In order to restrict access to a Post that doesn't belong to a user we need to add a register a Middleware

// app/Http/Kernel.php

<?php namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel {
	
	...
	
	protected $routeMiddleware = [
		...
        'post.owner' => 'Webinfinita\Blog\VerifyPostOwner',
	];

}

Related Packages

bjuppa/laravel-blog

Add blog functionality to your Laravel project

3,393 47
fbf/laravel-blog

A Laravel 4 package to add a simple blog to a site

2,959 73
sethsharp/blog-crud

A blog CRUD package

1,142 3
lufficc/xblog

A powerful and responsive blog system powered by laravel.

918 916
rowland/ooglee-core

Ooglee platform core library

131 0

Version History

Version Released PHP Laravel License
0.0.2 >=5.4.0 5.0.* MIT
0.0.1 >=5.4.0 5.0.* MIT