How to install CKEditor and upload image in CKEditor

The blog I write has a problem and solution. This is the problem I faced while working so it gives to the point solution. You may need it

Problem 1 (Installing CKEditor in Laravel)

While usingl laravel I got problem to install CKEditor. I downloaded and tried to link the js file but it didn’t work. So I got the solution.

Firs of all open command prompt in root folder of your project. I assumed you have already created the view file wher you want to use CKEditor.

1. Then Type
Composer require unisharp/laravel –ckeditor

 

 

2. The second step is only for below 5.5 laravel version. If you use 5.5+ version go to the third step

Go to config/app.php folder and paste this in Application Service Provider

Unisharp\Ckeditor\ServiceProvider::class,

 

3. The third step is to publish it in command prompt. Go back to the command prompt and type
php artisan vender:publish –tag=ckeditor

 

Now in view, in textarea give an id name (mine is editor)

<textarea class=”form-control” id=”editor” name=”summary-ckeditor”></textarea>

 

4. Then write this code below the textarea

<script src=”{{ URL::asset(‘ckeditor/ckeditor.js’) }}”></script>

<script type=”text/javascript”>

    CKEDITOR.replace(‘editor’);

</script>

Now run the view. I suppose you have already created route for this. You will get this kind of editor.

The second problem I faced about the image in CKEditor will be discussed in the next blog.

Problem 2 (How To Uplad Image In Ckeditor By Using Laravel)

CLICK HERE