ogestor / laravel-ckeditor
Laravel CKEditor
Requires
- intervention/image: ^2.3
- laravel/framework: ~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.7|~5.8|^6.0
- league/flysystem: ^1.0.8
- ogestor/laravel-package-helper: ^3.1|^6.0
Requires (Dev)
- hamcrest/hamcrest-php: ~1.2
- laravel/browser-kit-testing: ^1.0
- league/flysystem-aws-s3-v3: ^1.0.1
- mockery/mockery: ^0.9.5
- orchestra/testbench: ~3.2.4|~3.3.0|~3.4.0
- phpunit/phpunit: ~4.8.20|~5.0
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
-
Require the package using composer:
composer require ogestor/laravel-ckeditor
-
Add the service provider to the
providers
inconfig/app.php
:JeroenNoten\LaravelCkEditor\ServiceProvider::class,
-
Publish the public assets:
php artisan vendor:publish --tag=ckeditor-assets
Updating
-
To update this package, first update the composer package:
composer update ogestor/laravel-ckeditor
-
Then, if you have laravel 5.4 or less, publish the public assets with the
--force
flag to overwrite existing filesphp 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])