PHP Classes
elePHPant
Icontem

File: src/Http/routes.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon for Laravel  >  src/Http/routes.php  >  Download  
File: src/Http/routes.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Jaxon for Laravel
Laravel plugin to call PHP classes from with AJAX
Author: By
Last change: Fixed issue #1.
Starting from Laravel 5.2, the route must use the 'web' middleware for
the sessions to work properly.
Date: 2 years ago
Size: 697 bytes
 

 

Contents

Class file image Download
<?php

/*
|--------------------------------------------------------------------------
| Route to Jaxon request processor
|--------------------------------------------------------------------------
|
| All Jaxon requests are sent through this route to the JaxonController class.
|
*/

$routeName = config('jaxon.app.route', 'jaxon');
if(!
Route::has($routeName))
{
   
$route = Route::post($routeName, array(
       
'as' => 'jaxon',
       
'uses' => '\Jaxon\Laravel\Http\Controllers\JaxonController@process'
   
));
   
// Starting from Laravel 5.2, the route must use the 'web' middleware.
   
if(version_compare(app()->version(), '5.2.0', '>='))
    {
       
$route->middleware('web');
    }
}