Git Product home page Git Product logo

dropblockeditor's Introduction

Logo DropBlockEditor

Introduction

The DropBlockEditor package provides you with a cool drag and drop editor. It allows you to easily create your own custom blocks and make them editable through Livewire components.

  • Note: This package is in the pre-release stage. Code is subject to change and should not considered stable at this time.

Requirements

To use this package, you'll need:

  • To use with Livewire v3.

  • PHP 8.1 or higher

Installation

You can install the package via composer:

composer require mo_sweed/dropblockeditor

You can publish all files with:

php artisan vendor:publish --provider="Mo_sweed\DropBlockEditor\DropBlockEditorServiceProvider" โ€“-force

Once all files are published, open routes/web.php, and add this code at the end of the page:

require __DIR__.'/dropblockeditor.php';

After that, run this command:

php artisan migrate

Run the following artisan command to create a new Block with an edit component

php artisan dropblockeditor:make Text

Migrations

  • Name: pages

Model

  • Name: pages

  • Data: [title, slug, status, content]

  • The Route key is a slug

Route

  • update_page/{page:slug}: if you have a page

  • create_page: to make a page

  • Both routes using the same page: PageEiditor

PageEiditor

  • Location: App\Livewire\DropBlockEditor

  • Function: Check if the URL has (page:slug). If a page exists with (page:slug), then send all info page to DropBlockEditor. Else return 404. If the URL doesn't have (page:slug), then call DropBlockEditor.

DropBlockEditor

  • Location: App\Livewire\DropBlockEditor

  • Function: Get all existing blocks, page settings, and change Blocks location.

Blocks

A block has a visual side which is the Block class and an optional modified Livewire component (BlockEditComponent) to make it editable.

  • Block location: App\Classes\Blocks

  • BlockEditComponent: App\Livewire\DropBlockEditor\Components

Credits

License

The MIT License (MIT). Please see License File for more information.

dropblockeditor's People

Contributors

mosweed avatar

Watchers

 avatar

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.