CodeIn House

  • Laravel
  • WordPress
  • jQuery
  • Javascript
  • Contact
Home   HTML5   Laravel CK-Editor 4 Tutorial – How to Integrate CK-Edi ...

Laravel CK-Editor 4 Tutorial – How to Integrate CK-Editor 4 in Laravel 5.4

March 7, 2017 by SNK

integrate ckeditor in laravel 5

Today, in this laravel ckeditor tutorial we are going to see how to integrate ckeditor in laravel 5 which is now version 5.4 in its most recent update.

If you take a look at CK-Editor it is the most flexible text editor that we can use across our websites description section to embed custom HTML codes, add images & videos directly using drag and drop features that we can get from any other WYSIWYG Editor out there.

It makes easy for us to add images and videos without having to have good knowledge in programming and its also easy for clients to handle their content is very flexible manner.

Lets get started :-

What we are going to do ?

  1. Download fresh copy of ckeditor from their official website here.
  2. Integrate that package into laravel 5.4.

 

Step – 1

Extract ckeditor zip package inside public folder inside laravel project folder. Once you have extracted all the files, open up your blade where you want to display the editor.

In my case it would be index.blade.php. Initialize the CK-Editor in your blade template by looking at the code below.

index.blade.php
PHP
1
2
3
4
5
6
7
<script src="{{url('ckeditor/ckeditor.js')}}"></script>
<script>
var ckview = document.getElementById("ckview");
CKEDITOR.replace(ckview,{
language:'en-gb'
});
</script>

Once it have been added, Inside your textarea you need to specify the id of the textarea where you want your editor to be displayed. In my case i have given ckview to display editor.

Step 2 :-

Add an id to your textarea like below to display the editor in your textarea which would be now replaced with ckeditor.

index.blade.php
PHP
1
<textarea name="editor" id="ckview" cols="30" rows="10">soemthing</textarea>

Thats it, now you would have your textarea with ckeditor.

 

Still confused ?? Why dont you have full code so that you can understand whats happening.

index.blade.php
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Simple CK Editor CSS Implementation</title>
<link rel="stylesheet" href="">
<script src="{{url('js/jquery.min.js')}}"></script>
<script src="{{url('ckeditor/ckeditor.js')}}"></script>
</head>
<body>
<style>
* {
margin:10px auto;
text-align: center;
}
</style>
<div style="width: 800px;" class="center">
<form action="">
<textarea name="editor" id="ckview" cols="30" rows="10">Your Text from Editor</textarea>
</form>
</div>
<script>
var ckview = document.getElementById("ckview");
CKEDITOR.replace(ckview,{
language:'en-gb'
});
</script>
</body>
</html>

Still in problem ?? Let us know so that we can sort them out together through comments.

SHARE ON
Buffer

Enjoyed this article?

Like us on

HTML5 Javascript Laravel integrate ckeditor in laravel 5 laravel 5 text editor laravel ckeditor tutorial laravel wysiwyg editor

Avatar for SNK

About SNK

Hello Welcome to my Blog. I develop Websites Using Laravel Framwork & WordPress. Get Latest updates on Facebook | Twitter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get Connected !! With Us

TOP POSTS

  • How to Setup Spring MVC Project From Scratch in Intellij IDEA ?
  • Spring Configuration Class in JAVA [Class VS XML Config]
  • Annotations Based Configuration in Spring Framework
  • How to Configure Spring Framework with XML Configurations?
  • How to Remove Project Name from URL in JSP Project in Intellij IDEA ?

TUTORIALS TILL DATE

  • September 2022 (6)
  • June 2021 (7)
  • October 2020 (5)
  • September 2020 (6)
  • September 2018 (14)
  • August 2018 (3)
  • July 2018 (4)
  • March 2018 (8)
  • February 2018 (5)
  • January 2018 (1)
  • December 2017 (2)
  • August 2017 (8)
  • May 2017 (1)
  • April 2017 (1)
  • March 2017 (4)
  • February 2017 (3)
  • January 2017 (4)

CATEGORIES

  • Angular (2)
  • CSS3 (3)
  • D3 (3)
  • HTML5 (7)
  • JAVA (11)
  • Javascript (20)
  • jQuery (8)
  • Laravel (35)
  • Others (3)
  • PHP (11)
  • Spring (2)
  • WordPress (10)

Top Categories

  • Angular
  • CSS3
  • D3
  • HTML5
  • JAVA
  • Javascript
  • jQuery
  • Laravel
  • Others
  • PHP
  • Spring
  • WordPress

Get in Touch

DMCA.com Protection Status

Recent Articles

  • How to Setup Spring MVC Project From Scratch in Intellij IDEA ?
  • Spring Configuration Class in JAVA [Class VS XML Config]
  • Annotations Based Configuration in Spring Framework
  • How to Configure Spring Framework with XML Configurations?
  • How to Remove Project Name from URL in JSP Project in Intellij IDEA ?

© 2012-22 CodeIn House.  •  All Rights Reserved.