https://github.com/bubalubs/gravity
Laravel package that sets up a light flexible CMS with an admin control panel
https://github.com/bubalubs/gravity
admin admin-dashboard cms laravel laravel-package
Last synced: 8 months ago
JSON representation
Laravel package that sets up a light flexible CMS with an admin control panel
- Host: GitHub
- URL: https://github.com/bubalubs/gravity
- Owner: Bubalubs
- License: mit
- Created: 2019-09-25T15:42:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T23:24:06.000Z (almost 2 years ago)
- Last Synced: 2025-02-15T19:07:45.164Z (over 1 year ago)
- Topics: admin, admin-dashboard, cms, laravel, laravel-package
- Language: PHP
- Homepage:
- Size: 2.66 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/bubalubs/gravity)
[](https://packagist.org/packages/bubalubs/gravity)
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](https://laravel.com/docs/10.x/starter-kits#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](https://spatie.be/open-source) for their awesome libraries that this package relies on for permissions and media library!