I was under the impression that calling JavaScript::put() would affect only that controller action in which it was called. However, I'm finding that my unit tests are gaining because the JavaScript is finding its way into my API controller outputs.
My web routes file looks like this(I want to direct all web traffic to my SPA) and I wanted to pass some js variables through as well...
I figured that the route groups would isolate this from the API routes and stop what I was doing in here bleeding through, but perhaps I misunderstood?
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/
Route::get('/{catchall?}', function () {
JavaScript::put([
'APPTITLE' => htmlspecialchars_decode(config('app.name'))
]);
return View::make('partials.index');
})->where('catchall', '(.*)');
;
Have i misunderstood something or misconfigured something here?
I was under the impression that calling
JavaScript::put()
would affect only that controller action in which it was called. However, I'm finding that my unit tests are gaining because the JavaScript is finding its way into my API controller outputs.My web routes file looks like this(I want to direct all web traffic to my SPA) and I wanted to pass some js variables through as well...
I figured that the route groups would isolate this from the API routes and stop what I was doing in here bleeding through, but perhaps I misunderstood?
Have i misunderstood something or misconfigured something here?