PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
C
C++
Json
Codeigniter 4
htaccess
wordpress
react.js
Blogs
Fundamental
Python
Search Your Query
×
--- Select Category ---
PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
Blogs
Fundamental
Python
Most Popular Tutorials
What is Laravel?
Laravel Installation
Directory Structure
Htaccess Laravel
remove public from url
Artisan Command
Laravel Configuration
Laravel Routing
Namespaces
Request
Laravel Response
Controller
Model
Views
Blade Views
User Authentication
Multi User Authentication
Database: Seeding
Database Model
Database Query
ORM
One to One Relationship
One to Many Relationship
Many to Many Relationship
Has One Through
Has Many Through
Middleware
Get site url
Get Url Segment
Get images from storage folder
clear cache
Form class not Found
Flash message
Redirections
Flash messages
Path
Laravel Validation
Cookie
Session
Email Send
File uploading
CSRF Protection
Helper
Helper Function
Guzzle http client
Paypal payment gateway
Cron Job
Errors
Date Format
Display image on view page
Laravel CRUD
CRUD Example
CRUD Program
update user status using toggle button
Delete Multiple Records using Checkbox
Delete image from storage
Confirmation Before Delete Record
Remove/Trim Empty & Whitespace From Input Requests
Block IP Addresses from Accessing Website
How to Disable New User Registration in Laravel?
Redirect HTTP To HTTPS Using Laravel Middleware
CKEditor
How to generate Unique slug?
Tutorials Menus
What is Laravel?
Laravel Installation
Directory Structure
Htaccess Laravel
remove public from url
Artisan Command
Laravel Configuration
Laravel Routing
Namespaces
Request
Laravel Response
Controller
Model
Views
Blade Views
User Authentication
Multi User Authentication
Database: Seeding
Database Model
Database Query
ORM
One to One Relationship
One to Many Relationship
Many to Many Relationship
Has One Through
Has Many Through
Middleware
Get site url
Get Url Segment
Get images from storage folder
clear cache
Form class not Found
Flash message
Redirections
Flash messages
Path
Laravel Validation
Cookie
Session
Email Send
File uploading
CSRF Protection
Helper
Helper Function
Guzzle http client
Paypal payment gateway
Cron Job
Errors
Date Format
Display image on view page
Laravel CRUD
CRUD Example
CRUD Program
update user status using toggle button
Delete Multiple Records using Checkbox
Delete image from storage
Confirmation Before Delete Record
Remove/Trim Empty & Whitespace From Input Requests
Block IP Addresses from Accessing Website
How to Disable New User Registration in Laravel?
Redirect HTTP To HTTPS Using Laravel Middleware
CKEditor
How to generate Unique slug?
Share On Facebook
How to use CKEditor in Laravel Framework?
File name : index.php
<html>
<head>
<title>How to use CKEditor in Laravel Framework</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 use CKEditor in Laravel Framework</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>
Ckeditor Image Upload Example
File name : web.php
Route::get('ckeditor', 'CkeditorController@index'); Route::post('ckeditor/upload', 'CkeditorController@upload')->name('ckeditor.upload');
Controller
File name : CkeditorController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class CkeditorController extends Controller
{
/**
* success response method.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('ckeditor');
}
/**
* success response method.
*
* @return \Illuminate\Http\Response
*/
public function upload(Request $request)
{
if($request->hasFile('upload')) {
$originName = $request->file('upload')->getClientOriginalName();
$fileName = pathinfo($originName, PATHINFO_FILENAME);
$extension = $request->file('upload')->getClientOriginalExtension();
$fileName = $fileName.'_'.time().'.'.$extension;
$request->file('upload')->move(public_path('images'), $fileName);
$CKEditorFuncNum = $request->input('CKEditorFuncNum');
$url = asset('images/'.$fileName);
$msg = 'Image uploaded successfully';
$response = "<script>window.parent.CKEDITOR.tools.callFunction($CKEditorFuncNum, '$url', '$msg')</script>";
@header('Content-type: text/html; charset=utf-8');
echo $response;
}
}
}
view
File name : ckeditor.blade.php
<!DOCTYPE html>
<html>
<head>
<title>Laravel 6 Ckeditor Image Upload </title>
<script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
</head>
<body>
<h1>Ckeditor Image Upload</h1>
<textarea name="editor1"></textarea>
<script type="text/javascript">
CKEDITOR.replace('editor1', {
filebrowserUploadUrl: "{{route('ckeditor.upload', ['_token' => csrf_token() ])}}",
filebrowserUploadMethod: 'form'
});
</script>
</body>
</html>
Share On Facebook
Previous
Next
Trending Tutorials
PHP
100+ Tutorials
PHP OOPs
80+ Tutorial
Codeigniter
100+ Tutorial
Laravel
100+ Tutorials
NODE.JS
100+ Tutorials
Javascript
100+ Tutorials
Download Live Projects
Review & Rating
0.0
/ 5
0
Review
5
(
0
)
4
(
0
)
3
(
0
)
2
(
0
)
1
(
0
)
Write Review Here
Review
Submit Review
×
Submit
Ittutorial
Ittutorial
Most Popular Tutorials
Laravel Installation
File uploading
Htaccess Laravel
Redirections
Database: Seeding
What is Laravel?
Namespaces
Block IP Addresses from Accessing Website
clear cache
Blade Views
Delete Multiple Records using Checkbox
Get Url Segment
Database Model
One to Many Relationship
Confirmation Before Delete Record
Cookie
Helper
Middleware
Many to Many Relationship
Laravel Response
Important Link
Core php Online Advance Tutorails and video Tutorials.
How to manage Session in php Tutorials.
More .......
upcomming codeigniter and angular js tutorials.
Click here to see More ...
Hello Friend Please Follow & Share Ittutorial.
×
Ittutorial
Please Follow and Share ittutorial.
Ittutorial