定制 fbollon/lara-cms-lite 二次开发

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

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

fbollon/lara-cms-lite

最新稳定版本:0.3.5

Composer 安装命令:

composer require fbollon/lara-cms-lite

包简介

Content management system lite for Laravel app

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

Lara-cms-lite was created to allow some users to add and manage content on predefined business application pages in intranet, this avoids having to modify the application source code to change a text on a home page or other. We could also use this package to add a news-style page or blog to existing application.

Installation

Laravel from 6.x to 12.x are supported.

You can install the package via composer:

composer require fbollon/lara-cms-lite

Publish assets, config and views

  • tinymce to public/vendor/tinymce
  • lara-cms-lite config file and adjust values if needed in config/lara-cms-lite.php based on comments
  • lara-cms-lite views to views/vendor/lara-cms-lite
php artisan vendor:publish --provider="Fbollon\LaraCmsLite\LaraCmsLiteServiceProvider"

Or publish by tags

php artisan vendor:publish --provider="Fbollon\LaraCmsLite\LaraCmsLiteServiceProvider" --tag=public

php artisan vendor:publish --provider="Fbollon\LaraCmsLite\LaraCmsLiteServiceProvider" --tag=config

php artisan vendor:publish --provider="Fbollon\LaraCmsLite\LaraCmsLiteServiceProvider" --tag=views

To force publishing add --force flag.

Create required tables

php artisan migrate

A table named 'contents' will be created, if a table with the same name already exists in your app change value of 'table' in config/lara-cms-lite.php

Authorization

Add 1 method canManageLaraCmsLiteContent() to your \App\User file with your own logic

Define a gate in your App\Providers\AuthServiceProvider

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();

        Gate::define('lara-cms-lite-manage', function ($user) {
            return $user->canManageLaraCmsLiteContent();
        });

    }

Usage

Visit your application url : http://yourApplication/contents to start creating and managing content .

To display content in existing views of your application

In you default layout add this where you want to display content in your layout

@if (!empty($contents) && count($contents))
@include('lara-cms-lite::layouts.partials.contents')
@endif

Depending where you allow users to add content in yours methods controller add

// import model 
use Fbollon\LaraCmsLite\Models\Content;
// for each method you allow to display content
public function xxx()
{
    // get content 
    $contents = Content::getContextualContent();

    // and send content to the view
    return view('xxx.xxx', compact('contents'));
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固