Level 1
I still could not solve this problem
How Can I Upload Image With Ck Editor (V5) in Laravel? I think it has a package but I couldn't install it.
here is my code:
create.blade.php:
@extends('layouts.app')
@section('content')
<form action="{{route('ck.store')}}" method="post">
@csrf
<textarea id="editor" name="body">
Here goes the initial content of the editor.
</textarea>
<button type="submit" class="btn btn-primary btn-sm">Submit</button>
</form>
@endsection
<script src="{{asset('assets/js/ckeditor.js')}}"></script>
<script src="{{asset('assets/js/script.js')}}"></script>
my controller:
public function store(Request $request)
{
$ck=Ck::create([
'body' => $request->body,
]);
return redirect()->route('ck.index');
}
script.src:
ClassicEditor
.create( document.querySelector( '#editor' ) )
.then( editor => {
console.log( editor );
} )
.catch( error => {
console.error( error );
} );
Please or to participate in this conversation.