webbatools/laravel-ckeditor

Laravel CKEditor

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 32

Language:HTML

v3.8.3 2019-11-04 19:17 UTC

This package is auto-updated.

Last update: 2024-04-26 20:48:03 UTC


README

This package provides an easy way to set up CKEditor with Laravel 5. I think CKEditor is the best free WYSIWYG editors available. This package makes it super easy to use the editor with Laravel 5. It provides a custom blade directive @ckeditor('textareaId') to quickly integrate it in your forms.

Installation

  1. Require the package using composer:

    composer require webbatools/laravel-ckeditor
    
  2. Add the service provider to the providers in config/app.php:

    webbatools\LaravelCkEditor\ServiceProvider::class,
  3. Publish the public assets:

    php artisan vendor:publish --tag=ckeditor-assets
    

Updating

  1. To update this package, first update the composer package:

    composer update webbatools/laravel-ckeditor
    
  2. Then, publish the public assets with the --force flag to overwrite existing files

    php artisan vendor:publish --tag=ckeditor-assets --force
    

Usage

The package provides a custom blade directive @ckeditor('textareaId') that transforms a <textarea> into a CkEditor instance. Give your <textarea> an id attribute and add the blade directive at the bottom of your page, with the identifier of the <textarea>.

Example:

<textarea id="bodyField"></textarea>

@ckeditor('bodyField')

Configuration

If you need to configure the CkEditor instance, you can do that by passing a second argument with all options into the blade directive. Refer to the CkEditor config documentation to discover all possible options.

Example:

<textarea id="bodyField"></textarea>

@ckeditor('bodyField', ['height' => 500])