2017 © Pedro Peláez
 

library blog

image

virtualorz/blog

  • Thursday, June 21, 2018
  • by virtualorz
  • Repository
  • 0 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Installation

install by composer


composer require virtualorz/blog

edit config/app.php


'providers' => [
    ...
    Virtualorz\Blog\BlogServiceProvider::class,
    Virtualorz\Pagination\PaginationServiceProvider::class,
    Virtualorz\Tag\TagServiceProvider::class,
    Virtualorz\Cate\CateServiceProvider::class,
    Virtualorz\Fileupload\FileuploadServiceProvider::class,
    ...
]

'aliases' => [
    ...
    'Blog' => Virtualorz\Blog\BlogFacade::class,
    'Pagination' => Virtualorz\Pagination\PaginationFacade::class,
    'Tag' => Virtualorz\Tag\TagFacade::class,
    'Cate' => Virtualorz\Cate\PCateFacade::class,
    'Fileupload' => Virtualorz\Fileupload\FileuploadFacade::class,
    ...
]

migration db table


php artisan migrate

publish config


php artisan vendor:publish --provider="Virtualorz\Blog\BlogServiceProvider"

usage

1. get cate list data


$dataSet = Blog::list($param = []);

$param['page'] : displaypage, (*1)

$param['is_backend'] : 1 to be backend list, show disabled data, (*2)

$param['app'] : use app def in config, (*3)

$param['use_sn] : use_sn define your self for defferent system use, (*4)

$dataSet : return date, (*5)

2. add data to cate


Contact::add($param = []);

$param['app'] : use app def in config, (*6)

$param['use_sn] : use_sn define your self for defferent system use, (*7)

with request variable name required : blog-cate_id,blog-title,blog-content, (*8)

3. get cate detail


$dataRow = Contact::detail($blog_id);

4. edit data to cate


Contact::edit($param = []);

$param['app'] : use app def in config, (*9)

$param['use_sn] : use_sn define your self for defferent system use, (*10)

with request variable name required : blog-cate_id,blog-title,blog-content, (*11)

5. delete cate data


Contact::delete();

with request variable name required : id as integer or id as array, (*12)

6. enable cate data


Tag::enable($type);

with request variable name required : id as integer or id as array $type is 0 or1 , 0 to disable i to enable, (*13)

The Versions