How to add ckeditor with image upload in Laravel ?

By Hardik Savani | January 8, 2016 | | 8013 Viewer | Category : PHP Laravel


Share this post:

if you want to use ckeditor in laravel and you also want to add file uploading as well. if you are use simply in php then it is very simple. but if you are set laravel then you fetch many problem like i also fetch lots of problem.

Now, i will give you few step to set ckeditor with file uploading and you will easily apply this. this is a very simple to browse your image, file etc upload.

use ckeditor in php, use ckeditor in laravel 4, use ckeditor in laravel 5, how to add ckeditor in laravel, laravel ckeditor image upload, laravel ckeditor example, laravel ckeditor sample, ckeditor laravel 4, ckeditor laravel 5, laravel rich text editor

Step 1 : download ckeditor from its official website, i mean here : http://ckeditor.com/download

Step 2 : next download kcfinder for image uploading. here : http://kcfinder.sunhater.com/download.

Step 3 : then create new folder like : 'templateEditor' in your public directory and put both folder there.(public/templateEditor/ckeditor and public/templateEditor/kcfinder).

Step 4 : open public/templateEditor/ckeditor/config.js and put code as i under :

/**

* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.

* For licensing, see LICENSE.md or http://ckeditor.com/license

*/

CKEDITOR.editorConfig = function(config) {

// Define changes to default configuration here. For example:

// config.language = 'fr';

// config.uiColor = '#AADC6E';

config.filebrowserBrowseUrl = '/templateEditor/kcfinder/browse.php?opener=ckeditor&type=files';

config.filebrowserImageBrowseUrl = '/templateEditor/kcfinder/browse.php?opener=ckeditor&type=images';

config.filebrowserFlashBrowseUrl = '/templateEditor/kcfinder/browse.php?opener=ckeditor&type=flash';

config.filebrowserUploadUrl = '/templateEditor/kcfinder/upload.php?opener=ckeditor&type=files';

config.filebrowserImageUploadUrl = '/templateEditor/kcfinder/upload.php?opener=ckeditor&type=images';

config.filebrowserFlashUploadUrl = '/templateEditor/kcfinder/upload.php?opener=ckeditor&type=flash';

};

Step 5 : add code in your main blade file like as i give you under :

<head>

<title>Laravel</title>

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script src="/templateEditor/ckeditor/ckeditor.js"></script>

</head>

<body>

<textarea id="editor1" class="ckeditor"></textarea>

<script type="text/javascript">

CKEDITOR.replace( 'editor1' );

</script>

</body>

Try this.............



We are Recommending you: