Laravel 5.1在Javascript字符串上调用PHP文件

How to call some PHP file in Laravel 5.1.

I have to see of that PHP file echo.

Here is the Javascript codes

<script>
$(document).ready(function(){
    $('#example').DataTable({
        "processing": true,
        "serverSide": true,
        "ajax": 'processing.php'
    });
});
</script>

Hope you can write a route controller for that php file and call the route method in Javascript.

For example, Destination file: processing.php

Create a Route like this.

Route:get('processing', ['as=>'processing', 'uses'=>'ProcessingController@index']);

create a new controller with name ProcessingController.php,

[to create a controller in command : php artisan make:controller ProcessingController]

Inside the file add the business logic in index().

Now you can call the

<script>
$(document).ready(function(){
  var processing = '<?php echo URL::route('processing') ?>';
    $('#example').DataTable({
        "processing": true,
        "serverSide": true,
        "ajax": processing
    });
});
</script>