Francisunoxx Francisunoxx - 1 year ago 89
PHP Question

Why dd($request) can't get the request of TinyMCE using Laravel 5.2

I don't know which the cause but I have a

plugin with a selector which is my
. I'm trying to check if I get the request on my
which is the text editor. When I check it doesn't have any column for my
which has a id of
+request: ParameterBag

Screenshot below.


As you can see here it doesn't have any key which is
id of my textarea. Can anyone tell me how can I solve this.


selector: '#content',
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor save'
], //The plugins configuration option allows you to enable functionality within the editor.
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | save',
save_enablewhendirty: true,
height: 400,

function get_editor_content()

// Get the HTML contents of the currently active editor

// Get content of a specific editor:
var selectContent = tinymce.get('content').getContent();



I can get here the value of my textarea but still don't have any idea how can I save or insert this on my database. Any help would greatly appreciated.


<form class = "form-vertical" role = "form" method = "post" action = "{{ route('document.create')}}">

<div class = "form-group">
<label for = "title" class = "control-label">Title:</label>
<input type = "text" name = "title" class = "form-control">

<div class = "form-group">

<label for = "to" class = "control-label">To:</label>
<select onChange = "showUserOptions(this)" name = "to[]" multiple class = "form-control" id = "myUserList">

@foreach ($result as $list)
<option value = "{{ $list->id }}">{{ $list->username }}</option>


<div class = "form-group">

<label for = "category" class = "control-label">Category:</label>
<select onChange = "showCategoryOptions(this)" name = "category" class = "form-control" id = "myCategory">

<option selected disabled>Please select role</option>
@foreach ($resultCategory as $categoryList)
<option value = "{{ $categoryList->id }}">{{ $categoryList->category_type }}</option>



<div class = "form-group">
<textarea id="content"></textarea>

<div class = "form-group">
<button type = "submit" class = "btn btn-primary" onclick="get_editor_content()">Send</button>

<input type = "hidden" name = "_token" value = "{{ Session::token() }}">



class DocumentController extends Controller
public function getDocuments()
$result = DB::table('users')->where('id', '!=', Auth::id())->get();

$resultCategory = DB::table('categories')->get();

return view ('document.create')->with('result', $result)->with('resultCategory', $resultCategory);

public function postDocuments(Request $request)
'to' => 'required',
'title' => 'required|alpha_dash|max:255',
'category' => 'required',
'content' => 'required',


Answer Source

Try to add a name to the textarea:

<div class = "form-group">
    <textarea id="content" name="content"></textarea>