bubalubs/gravity
Composer 安装命令:
composer require bubalubs/gravity
包简介
A Flexible Laravel CMS
README 文档
README
Gravity is a Laravel package that sets up a light flexible CMS with an admin control panel
Installation
Install using composer
composer require bubalubs/gravity
Create database tables by running migrations
php artisan migrate
Publish CSS/JS files for admin control panel
php artisan vendor:publish --tag=public
Add the HasRoles Trait to your User model
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use Notifiable, HasRoles;
...
To get going with basic auth, you can use Laravel Breeze
Usage
Using blade templating, you can output the CMS values.
To ouput global content use {{ $globalContent['field-name']}}
To show page content use {{ $content['field-name'] }}
Entities (Models)
Entities allow you to work with a custom Laravel model and adds CRUD options to the admin.
To work with images on an entity your model must implement the following interface and trait:
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
class YourModel extends Model implements HasMedia
{
use HasMediaTrait;
...
Customizing Views
Publish view files to your laravel view directory then edit them to make changes
php artisan vendor:publish --provider=Bubalubs\Gravity\GravityServiceProvider
Updating
Update to the latest views (This will overwrite any changes you have made)
php artisan vendor:publish --provider=Bubalubs\Gravity\GravityServiceProvider --tag=public --force
Thanks
Thanks to spatie for their awesome libraries that this package relies on for permissions and media library!
bubalubs/gravity 适用场景与选型建议
bubalubs/gravity 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 76 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bubalubs/gravity 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bubalubs/gravity 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 76
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-12
