I\'d like to use this bundle: laravel-ckeditor but I have troubles in nesting it in my view (all previous installation steps I\'ve done successfully). How can i connect Form::te
here is an example of working TinyMCE:
<!-- title field -->
<p>{{ Form::label('title', 'Tytuł') }}</p>
{{ $errors->first('title', '<div class="alert alert-error"><a class="close">×</a>:message</div>') }}
<p>{{ Form::text('title', $value = $post->title, $attributes = array(Input::old('title'))); }}</p>
<!-- body field -->
<p>{{ Form::label('body', 'Tekst') }}</p>
{{ $errors->first('body', '<div class="alert alert-error"><a class="close">×</a>:message</div>') }}
<p>{{ RTE::rich_text_box('body',$post->body,array('att'=>array('id'=>'editorID'),'selector'=>'editorSelector','mode'=>'full','setup'=>array('skin'=>'o2k7','skin_variant'=>'black'))) }}
</p>
<!-- submit button -->
<p>{{ Form::submit('Edit') }}</p>
the trick was to use it INSTEAD of Form::text (and change all file permissions in /laravel/public/bundles/* for 0755) the same thing was about CKEditor. hope it will help others in a future (:
steps are:
install the editor first via composer by running the command:
composer require unisharp/laravel-ckeditor
Add this to ServiceProvider in config/app.php
to the providers array:
'providers' => [
Unisharp\Ckeditor\ServiceProvider::class,
back at the command line again, Publish the resources:
php artisan vendor:publish --tag=ckeditor
Now to embed it into a textarea
bind them with an id
<script src="{{ url('/vendor/unisharp/laravel-ckeditor/ckeditor.js') }}"></script>
<script>
CKEDITOR.replace( 'your_id' );
</script>
<textarea id="your_id"></textarea>
for these steps they had their own github repository
NOTE: if you are using Laravel Collictive to add the textarea and bind the id
to it use this:
{{Form::textarea('desc', '', ['id' => 'your_id'])}}
AND then display the nice formatted content like this:
{!!$post->desc!!}
where $post->desc
is the returned stored value from the database