I want to call Laravel redirect from controller per documentation
https://laravel.com/docs/5.6/redirects#redirecting-controller-actions
but I get this error:
InvalidArgumentException Route [/gosterge_paneli] not defined.
here is how my codes look like
layout.blade.php
$("#myRedirectButton").click(function(){
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
method: 'post',
dataType: 'text',
url: 'redirect-testing-link',
success: function (data)
{
}
});
});
web.php
Route::post('/redirect-testing-link', function () {
return redirect()->route('/gosterge_paneli');
});