webinfinita/blog 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webinfinita/blog

最新稳定版本:0.0.2

Composer 安装命令:

composer require webinfinita/blog

包简介

Simple blog for laravel 5

README 文档

README

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',
	];

}

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-16