fbollon/lara-cms-lite
Composer 安装命令:
composer require fbollon/lara-cms-lite
包简介
Content management system lite for Laravel app
关键字:
README 文档
README
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
--forceflag.
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.
fbollon/lara-cms-lite 适用场景与选型建议
fbollon/lara-cms-lite 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「fbollon」 「lara-cms-lite」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fbollon/lara-cms-lite 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fbollon/lara-cms-lite 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fbollon/lara-cms-lite 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-04