2017 © Pedro Peláez
 

library blog

Simple blog for laravel 5

image

webinfinita/blog

Simple blog for laravel 5

  • Thursday, April 16, 2015
  • by webinfinita
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Webinfinita Simple Blog for Laravel 5 (BETA)

Note: Don't use this package just yet. Work in progress., (*1)


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

Installation

First we need to install it through composer, (*3)

composer require "webinfinita/blog"

Then we need to add the service provider, (*4)

// config/app.php

<?php

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

Publish the migration and views, (*5)

php artisan vendor:publish

We use a Trait to make a User have many Posts, (*6)

// 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, (*7)

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

}

The Versions

16/04 2015

dev-master

9999999-dev

Simple blog for laravel 5

  Sources   Download

MIT

The Requires

 

by Jorge Garcia Coello

laravel blog

16/04 2015

0.0.2

0.0.2.0

Simple blog for laravel 5

  Sources   Download

MIT

The Requires

 

by Jorge Garcia Coello

laravel blog

16/04 2015

0.0.1

0.0.1.0

Simple blog for laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jorge Garcia Coello

laravel blog