How to Install and Use CKEditor in Laravel?
This simple article demonstrates of laravel install ckeditor example. if you have question about how to install ckeditor in laravel 7 then i will give simple example with solution. Here you will learn how to use ckeditor in laravel.
i would like to share with you how to install and use ckeditor in laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11. Alright, let’s dive into the steps.
Sometime we need to use rich textbox in our laravel application at that time i will suggest to use CKEditor, CKEditor is wide range use and very popular. you can easily use ckeditor without using any library here.
CKEditor provide to use HTML Element for text content formatting. CKEditor provide listing, image upload, link, font style, bold, italic etc. here i will give you simple example that will show you how to add and use CKEditor in laravel app.
You can get bellow preview:
Blade File Code:
Let's see simple example blade file code using cdn js file library:
<html>
<head>
<title>How to Install And Use CKEditor In Laravel? - ItSolutionStuff.com</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-8 offset-2 mt-5">
<div class="card">
<div class="card-header bg-info">
<h6 class="text-white">How to Install And Use CKEditor In Laravel? - ItSolutionStuff.com</h6>
</div>
<div class="card-body">
<form method="post" action="" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label>Name</label>
<input type="text" name="name" class="form-control"/>
</div>
<div class="form-group">
<label><strong>Description :</strong></label>
<textarea class="ckeditor form-control" name="description"></textarea>
</div>
<div class="form-group text-center">
<button type="submit" class="btn btn-success btn-sm">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.ckeditor').ckeditor();
});
</script>
</html>
Display Content:
after store content of rich textbox then you can display as bellow on listing page.
{!! $post->description !!}
Now you can check your own.
Few days ago i posted tutorial about Laravel CKEditor with image, so if you want to add that feature that follow this tutorial: Laravel 7 CKEditor with Image Upload.
You can also use Summernote Editor as here: Laravel 7 Summernote Editor Example.
i hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel Livewire Form Example
- How to Increase Session Lifetime in Laravel?
- Laravel Collection SortBy Tutorial with Examples
- Laravel 7 Pagination Tutorial
- Laravel Traits | How to Create Trait in Laravel?
- Laravel 8 Ckeditor Image Upload Example
- PHP CKEditor Custom File Upload Example
- PHP CKEditor with Image Upload using KCFinder Example
- How to Add CKEditor Required Field Validation in JQuery?
- How to get ckeditor value with tags on ajax-submit ?