Git Product home page Git Product logo

customberg-php's Introduction

Demo GIF

Instalation

composer require customberg/customberg-php:"*"

Add vendor files to your project (CSS, JS, Config, Views):

php artisan vendor:publish --provider="VanOns\Laraberg\LarabergServiceProvider"
php artisan vendor:publish --provider="Customberg\PHP\CustombergServiceProvider"

Usage

The model that you want to use this block editor should have:

use VanOns\Laraberg\Traits\RendersContent;

class Page extends Model
{
    use RendersContent;
}

In the backpack crud controller you must create the crud field like this:

CRUD::field('content')
    ->label('Page content')
    ->type('customberg')
    ->view_namespace('customberg::');

Update

After an update, get the latest assets using:

php artisan vendor:publish --tag="customberg-assets" --force
php artisan vendor:publish --provider="VanOns\Laraberg\LarabergServiceProvider" --tag="public" --force

Example project

git clone https://github.com/customberg/customberg-php
cd customberg-php/example
docker compose up -d
docker-compose exec php su app -c 'cd example; composer install'
docker-compose exec php su app -c 'cd example; cp .env.example .env; php artisan key:generate'
docker-compose exec nginx su app -c 'cd /app/example/public/; ln -s ../storage/app/public storage'

Navigate to http://localhost:8084 and press login.

Enjoy !

Roadmap:

A checkbox and a switch field
Radio field
Slider field
Google Maps field
Documentation !
Icon picker field

Changelog:

v0.10 - 2023-04-02

  • Added file extension validation to upload_image.
    Use 'allowed_types' => ['png', 'jpg', 'webp', 'svg'],
  • Added upload_file for files without preview.
    Use 'multiple' => true, if you want multiple files in the same field.

v0.9 - 2023-01-01

  • Multilanguage fine tuning, made configurable language list and bugfixing
  • Multilanguage only supports fields text and rich_text, and works inside repeatable field.

v0.8 - 2022-12-31

  • Fine tuning for repeatable field frontend
  • Added buttons to move and duplicate a item inside repeatable
  • Added example block for repeatable

v0.7 - 2022-12-30

  • First version published to packagist.org ! 🎉🥳
  • Only available fields are: text, rich_text, color, upload_image
  • Repeatable is present but untested. Multilanguage present but untested and hardcoded.

customberg-php's People

Contributors

andreitelteu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

khanhnv219

customberg-php's Issues

Block pattern

Hello. Is it possible to use block patterns? Also, can you open the discussion section so that a new issue is not created in case of questions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.