Code Monkey home page Code Monkey logo

laravel-contentbuilderjs's Introduction

Laravel ContentBuilderJs

Latest Stable Version Total Downloads Latest Unstable Version License TravisCI StyleCI

This is a package made for laravel 5.4 and helps in the integration of a comercial product Innovastudio ContentBuilder.js in a way that its using a couple of tables to store the data. This plugins allows you, not only, to create and save templates in the database, but also allows you to create your own snippets that are organized by categories.

This package does not comes with ContentBuilder.js source files. You have to purchase it and put all the files in the public folder.

Docs

Installation in 4 steps

Step 1: Install package

Add the package in your composer.json by executing the command.

composer require ksoft/laravel-contentbuilderjs

Next, add the service provider to config/app.php

Ksoft\ContentBuilderJs\BuilderServiceProvider::class,

Step 2: Migrations

This plugin uses couple of tables cbldjs_templates and cbldjs_blocks, run following command to migrate the tables:

php artisan migrate

Step 3: Publish vendors

You can install all the following by running a single command:

php artisan vendor:publish --provider="Ksoft\ContentBuilderJs\BuilderServiceProvider"

Or you can do each one individualy using the --tag

// Configuration file config/content-builder-js.php
php artisan vendor:publish --provider="Ksoft\ContentBuilderJs\BuilderServiceProvider" --tag=config
// ContentBuilder.js files must be put in public/vendors/content-builder-js
php artisan vendor:publish --provider="Ksoft\ContentBuilderJs\BuilderServiceProvider" --tag=public
// Views
php artisan vendor:publish --provider="Ksoft\ContentBuilderJs\BuilderServiceProvider" --tag=views

Step 4: Routes and backend menu links

We need to add the rotues to routes/web.php

\Ksoft\ContentBuilderJs\BuilderServiceProvider::routes();

middlewares can be configured trough the config('content-builder-js.middlewares') by default them protected with web,auth

You now will be able to run the plugin but for convenience this are the main routes you need to call to have you running:

<li><a href="{{route('cb_template.list')}}"><i class="fa fa-html5 fa-fw"></i> Template pages</a></li>
<li><a href="{{route('cb_block.list')}}"><i class="fa fa-code fa-fw"></i> Template Blocks</a></li>

Troubleshooting and Configuration tips

Layouts

To fully integrate with your custom layouts define the name of the layout using the config('content-builder-js.middlewares') parameter and add couple of stack to inject the CSS @stack('stylesheets') and for javascripts @stack('scripts')

CSRF Token

By default, the saveimage.js script that comes with Contentbuilder.js does not include the laravel token, to fix this we need to add a token field to this file arround line 50

'<input id="_token" name="_token" type="hidden" value="'+ customval +'" />' +

License

The Laravel ContentBuilderJs package is licensed under the terms of the MIT license and is available for free.

Links

laravel-contentbuilderjs's People

Contributors

kikoseijo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-contentbuilderjs's Issues

can't make this package work

I try to use this package,
I have contentbuilder.js
I did the composer but the migration files were not copied. So i copied the rest of the files manually. Added to the sevice providers. Also the routes
Added the links on the test page. but when i click on it i get the error class doesnt exist

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.