In Laravel 5.4, I need to use an url instead route in a javascript file.
Right now I have a blade file with this code:
@section('after-scripts')
{{ Html::script("https://cdn.datatables.net/v/bs/dt-1.10.15/datatables.min.js") }}
<script>
$(function () {
$('#users-table').DataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("admin.access.user.get") }}',
type: 'post',
data: {status: 1, trashed: false}
},
columns: [
{data: 'id', name: '{{config('access.users_table')}}.id'},
{data: 'first_name', name: '{{config('access.users_table')}}.first_name'}, ],
order: [[0, "asc"]],
searchDelay: 100
});
});
</script>
But I want to take off the blade this and save it as a normal .js file in my js assets. What should I do with the blade helpers like route()and config()?
JavaScript::put(...)