Download the PHP package hovornyan/laravel-grapesjs without Composer
On this page you can find all versions of the php package hovornyan/laravel-grapesjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hovornyan/laravel-grapesjs
More information about hovornyan/laravel-grapesjs
Files in hovornyan/laravel-grapesjs
Package laravel-grapesjs
Short Description A package for use Grapes.js in Laravel
License MIT
Informations about the package laravel-grapesjs
Installation
composer require hovornyan/laravel-grapesjs
Publish files
php artisan vendor:publish --provider="Dotlogics\Grapesjs\GrapesjsServiceProvider"
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"
php artisan migrate
npm i grapesjs
npm i grapesjs-blocks-basic
npm i grapesjs-blocks-bootstrap4
npm i grapesjs-tui-image-editor
npm i toastr
Get Start
-
Add 'gjs_data' column to the model's database table (e.g Page), for which you are going to use the editor.
-
Implement Editable Interface and use the EditableTrait trait for the Model class
-
Next Create a Route for editor
-
In your controller, use the EditorTrait and add the editor method
- Open this route /pages/:page_id/editor (where the :page_id is the id of your model)
Placeholders
Placeholders are like short-code in wordpress. The synax of placeholder is
[[This-Is-Placeholder]]
Create a file named "this-is-placeholder.blade.php" in "/resources/views/vendor/grapesjs/placeholders" directory.
The the placeholder will be replaced by the content of the relative blade file "this-is-placeholder.blade.php"
Templates
You can create a template (a block) in the "/resources/views/vendor/grapesjs/templates" directory. And the templates will be availabe in the block section of edittor.
Display output
The "Editable" model (e.g. Page) will have two public properties, css and html. In your blade file you can use these properties to display the content.
Thank you for using.
All versions of laravel-grapesjs with dependencies
illuminate/support Version ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0
jd-dotlogics/laravel-media Version ^2