https://github.com/blwsh/cms
Laravel frontend CMS that allows you to output any model property as an editable field on your frontend.
https://github.com/blwsh/cms
cms docker frontend-cms laravel
Last synced: about 2 months ago
JSON representation
Laravel frontend CMS that allows you to output any model property as an editable field on your frontend.
- Host: GitHub
- URL: https://github.com/blwsh/cms
- Owner: blwsh
- License: agpl-3.0
- Created: 2019-11-25T10:54:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T23:54:20.000Z (over 6 years ago)
- Last Synced: 2025-02-05T06:16:11.064Z (over 1 year ago)
- Topics: cms, docker, frontend-cms, laravel
- Language: PHP
- Homepage: https://blw.sh
- Size: 209 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Frontend CMS
[](https://packagist.org/packages/uniben/cms)
[](https://packagist.org/packages/uniben/cms)
[](//packagist.org/packages/uniben/cms)
[](https://packagist.org/packages/uniben/cms)
A content management system that allows you to output editable content to the page.
## Install
```shell script
$ composer require uniben/cms
```
## Examples
```php
$model->field // Field value
```
```php
$model->field->title('Default value', 'h2', ['class' => 'example', 'rand']) // Output
Field value
```
```php
$model->field->image() // Output
```
## Restricting editable capabilities
Allow everyone to edit a particular model:
```php
class X extends Editable {
public function canEdit()
{
return true;
}
}
```
Only allow logged in users to edit:
```php
class X extends Editable {
public function canEdit()
{
return auth()->user(); // Could even check their permissions here?
}
}
```
## Contributing
For an easy install of a development environment you can use docker to run using docker. The docker file will install laravel and the package for you along with a temporary database.
### Install
```shell script
$ make install
```
### Start
```shell script
docker-compose up -d
```
Visit `localhost:8080`
## How it works
When an editable field is rendered it is given an id which maps to the model type, model id and updated field.
When an update/save is made editable fields which belong to the same model are collated in to an array and sent to an update controller.
## Todo
* Switch edtable types render methods over to views rather than generatng inside of a method.
* Handle redirect responses from edtables when a new product is created.
* Make edtables on the frontend reactive using VueX
* Use UniBen/laravel-graphqlable for an easy to use documented API.
* Get wwyswig and image upload fields working using standard libraries.
* Improve editable type caching and queries in admin
* Make editable fields revisionable
* Improve code qualiity
* Aim for 100% code coverage
* Make dynamic registration of editable types easy via a service provider
* Reduce JS bundle size as much as possible
* Remove server side rendered editables and use vue components with ssr instead to simplify process.