Skip links

Adding CKEDITOR 4 to laravel application

Its quite simple to add Ckeditor to any laravel application. Its a javascript library so it doesn’t matter which laravel version you are using.

Steps to follow

  1. Visit Ckeditor Website – https://ckeditor.com/ckeditor-4/download/
  2. Download full package (without Easy Image)
  3. Extract download zip forlder and paste ckeditor folder in your laravel public folder
  4. Now Simply Include ckeditor js file in your header via following code. <script type=”text/javascript” src=”{{asset(‘ckeditor/ckeditor.js’)}}”></script>
  5. Last step is to initialize ckeditor on a textarea. Full Code mentioned below.
<script type="text/javascript" src="{{asset('ckeditor/ckeditor.js')}}"></script>

<!-- Replacing any textarea with CKEDITOR via below code -->
<script>
                // Replace the <textarea id="description"> with a CKEditor 4
                // instance, using default configuration.
                CKEDITOR.replace('description');
                CKEDITOR.replace('notes');
            </script>

Leave a comment