Skip to content

Commit 0132f11

Browse files
committed
Use container instead of facade alias.
1 parent dda8378 commit 0132f11

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/Http/routes.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
<?php
22

3+
$router = app('router');
4+
35
// Api-tester base route. This is entry point for frontend-SPA.
4-
Route::get('/', [
6+
$router->get('/', [
57
'as' => 'home',
68
'uses' => 'HomeController@index',
79
]);
810

911
// Fetch all Laravel routes.
10-
Route::post('routes/index', 'RouteController@index');
12+
$router->post('routes/index', 'RouteController@index');
1113

12-
Route::post('requests/index', 'RequestController@index');
13-
Route::post('requests/store', 'RequestController@store');
14-
Route::post('requests/update', 'RequestController@update');
15-
Route::post('requests/destroy', 'RequestController@destroy');
14+
$router->post('requests/index', 'RequestController@index');
15+
$router->post('requests/store', 'RequestController@store');
16+
$router->post('requests/update', 'RequestController@update');
17+
$router->post('requests/destroy', 'RequestController@destroy');
1618

1719
// We won't publish library's assets.
1820
// Instead we'll pass them via app which is slower but fine for development.
19-
Route::group(['prefix' => 'assets'], function () {
21+
$router->group(['prefix' => 'assets'], function ($router) {
2022

2123
$filePattern = '^([a-z0-9_\-\.]+)$';
2224

23-
Route::get('fonts/{_file}', [
25+
$router->get('fonts/{_file}', [
2426
'as' => 'image',
2527
'uses' => 'AssetsController@font'
2628
])->where('_file', $filePattern);
2729

28-
Route::get('img/{_file}', [
30+
$router->get('img/{_file}', [
2931
'as' => 'image', 'uses' => 'AssetsController@image'
3032
])->where('_file', $filePattern);
3133

32-
Route::get('{_file}', [
34+
$router->get('{_file}', [
3335
'as' => 'file',
3436
'uses' => 'AssetsController@index'
3537
])->where('_file', $filePattern);
@@ -44,7 +46,7 @@
4446
* This route is debug only, hence in production
4547
* it isn't registered and route cache is allowed.
4648
*/
47-
Route::any('* routes should not be cached',[
49+
$router->any('* routes should not be cached',[
4850
'as' => 'routes-should not be cached',
4951
'uses' => function () { return 'Api-tester routes-should not be cached';},
5052
]);

0 commit comments

Comments
 (0)