We are using Laravel 5 and have a route that handled all requests:
Route::any('{all}', 'AllController')
->where('all', '.*');
However this is causing one challenge: it redirects everything including images, JS and CSS.
We would like assets (static content) to be handled by the web server and Laravel to only handle dynamic content. We tried this:
Route::any('{all}', 'AllController')
->where('all', '.*')->where('all', !=, 'assets/.*');
But it gives syntax error unexpected '!=' (T_IS_NOT_EQUAL)
.
How can we construct a route that handles everything except assets (static content)?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire