Meysam Saberi
Meysam Saberi

Reputation: 184

How to run CKEditor package in Laravel?

Hi I use this package for Laravel 5.2 but it doesn't work for me. Can someone help me ?

<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
<script> 
    $('textarea').ckeditor();
    // if class is prefered.
    // $('.textarea').ckeditor();
</script>

My Console Screenshot

Upvotes: 1

Views: 2682

Answers (5)

Emmanuel Okechukwu
Emmanuel Okechukwu

Reputation: 1

Sometimes yo may need to point your source one level higher from the current directory. You achieve this by adding ../ to your source directory. Check it below

<script src="../vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<script src="../vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script>
<script> 
    $('textarea').ckeditor();
    // if class is prefered.
    // $('.textarea').ckeditor();
</script>

Upvotes: 0

Abel Agoi
Abel Agoi

Reputation: 131

please try to use jquery version 1.12.0, i had same issue but got it resolved using j v1.12.0

Upvotes: 3

The Oracle
The Oracle

Reputation: 2493

I got the same issue but using the cdn link <script src="//cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script> instead, solved my problem.

check this

Upvotes: 0

gvozd1989
gvozd1989

Reputation: 300

By default you may use id of the textarea in replace function.

Upvotes: 1

Meysam Saberi
Meysam Saberi

Reputation: 184

my page code

@extends('layouts.app')
{!! Html::script('js/jquery.min.js') !!}
@section('content')
<div class="container spark-screen">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="panel panel-default">
                <div class="panel-heading">Dashboard</div>

                <div class="panel-body">
                    <script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
                    <script>
                        CKEDITOR.replace( 'article-ckeditor' );
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

Upvotes: 0

Related Questions