Issue is i am not able to get bootstrap modal textarea input value using Input::get(), it returns null.
Modal's submit and text input(my view):
<button type="button" class="btn btn-danger" onclick="customModalSubmitFunction('modalID')">Submit</button>
JS function:
function customModalSubmitFunction(modalID){
$.ajax({
type: "POST",
url: "urlRouteToController"
});
}
Route.php route
Route::post('urlRouteToController', array(
'uses' => 'myController@insertValueIntoDatabase',
'as' => 'urlRouteToController'
));
Controller
public function myController(){
$dbModel = new Model;
$dbModel->column1 = Input::get('textbox1');
$dbModel->save();
}
In conclusion, i cannot get posted data using Input::get('textbox1'). But inserting data into database as null values (because i cannot get textbox value) part works.
Thanks in advance.
use Illuminate\Http\Request;place this on top right below the namespace of your controller then in the functionpublic function myController(Request $request)Then u can try to var dump the request variable to check if you are reciving any data. for more info check laravel.com/docs/5.0/requests