定制 gbrock/laravel-pages 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

gbrock/laravel-pages

最新稳定版本:0.1.1

Composer 安装命令:

composer require gbrock/laravel-pages

包简介

README 文档

README

A Laravel 5.1 package designed to add pages to your Laravel application. A page is just content defined by specific URL, or slug. A page may or may not be published.

Installation

  1. Run composer require gbrock/laravel-pages from your project directory.

  2. Add the service provider to the providers array in config/app.php:
    Gbrock\Pages\Providers\PageServiceProvider::class,

  3. Publish the migrations, views, and config file:
    php artisan vendor:publish --provider="Gbrock\Pages\Providers\ContactableServiceProvider"

  4. Run the migrations:
    php artisan migrate

Usage

Creating a Public Page

Create a Page model:

\Gbrock\Pages\Models\Page::create([
    'title' => 'Hello, World',
    'content' => '<p>Hi everybody</p>',
    'public' => true,
]);

...which is now accessible by browsing to /hello-world!

Making a Domain

A domain is a set of pages which are always under a specific slug. For example, you might make a "BlogPage" model whose members are always accessible under blog/{slug}:

<?php

namespace App;

use Gbrock\Pages\Models\Page;
use Gbrock\Pages\Traits\Domainable;

class BlogPage extends Page {

    use Domainable;

    protected static $domain = 'blog';

}

Then you can query that model for only that domain of pages. Please note that, by default, domained pages will be included in queries when using the above Page model. In order to ignore domained pages, extend the included Page model and add ignorable domains to the $subdomains property:

<?php

namespace App;

use Gbrock\Pages\Models\Page as BasePage;

class Page extends BasePage
{
    protected static $subdomains = ['blog'];
}

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-03-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固