Laravel 9 Integrate Ckeditor With Example

Laravel 9 Integrate Ckeditor With Example

Today, We will explain to you how to integrate CKEditor in Laravel 9 with example. CKEditor editor is one type of WYSIWYG HTML editors like TinyMCE.

When we need to store long text, article content, product summary, and different tag content with the description in our database we use the WYSIWYG HTML editors.

The WYSIWYG editor free to install our laravel application. let’s follow the below steps through integrate CKEditor in Laravel 9.

Overview

Step 1: Install Laravel

Step 2: Setting Database Configuration

Step 3: Create a Table using migration

Step 4: Install Package

Step 5: Add providers

Step 6: Create Route

Step 7: Create a Model and Controller

Step 8: Create Blade Files

Step 9: Run Our Laravel Application

Step 1: Install Laravel

We are going to install laravel 9, so first open the command prompt or terminal and go to xampp htdocs folder directory using the command prompt. after then run the below command.

Step 2: Setting Database Configuration
After the complete installation of laravel. we have to database configuration. now we will open the .env file and change the database name, username, password in the .env file. See below changes in a .env file.

Step 3: Create a Table using migration
Now, We need to create a migration. so we will below command using create the articles table migration.

After complete migration. we need below changes in the database/migrations/create_articles_table file.

Run the below command. after the changes above file.

Step 3: Install Package

Now, We will install “unisharp/laravel-ckeditor” package. so first open the composer.json file and add the below line.

Step 5: Add providers

We will add below providers and aliases in the “config/app.php” file.

After successful the above steps, run the below command to publish the assets, which will copy from vendor\unisharp\laravel-ckeditorto public\vendor\unisharp\laravel-ckedito

Step 6: Create Route

Add the following route code in the “routes/web.php” file.

Step 7: Create a Model and Controller

Here below command help to create the controller and model.

Article.php

ArticleController.php

Step 8: Create Blade Files

Finally, We will create the article-form.blade.php file in the “resources/views/” folder directory and paste the below code.

article-form.blade.php

Step 9: Run Our Laravel Application
We can start the server and run this example using the below command.

Now we will run our example using the below Url in the browser.

Please follow and like us: