Skip to content

Commit 21568e4

Browse files
committed
Default new bootstrap/app.php
1 parent 1d53aeb commit 21568e4

File tree

2 files changed

+24
-53
lines changed

2 files changed

+24
-53
lines changed

bootstrap/app.php

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,21 @@
11
<?php
22

3-
/*
4-
|--------------------------------------------------------------------------
5-
| Create The Application
6-
|--------------------------------------------------------------------------
7-
|
8-
| The first thing we will do is create a new Laravel application instance
9-
| which serves as the "glue" for all the components of Laravel, and is
10-
| the IoC container for the system binding all of the various parts.
11-
|
12-
*/
13-
14-
$app = new Illuminate\Foundation\Application(
15-
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__),
16-
);
17-
18-
/*
19-
|--------------------------------------------------------------------------
20-
| Bind Important Interfaces
21-
|--------------------------------------------------------------------------
22-
|
23-
| Next, we need to bind some important interfaces into the container so
24-
| we will be able to resolve them when needed. The kernels serve the
25-
| incoming requests to this application from both the web and CLI.
26-
|
27-
*/
28-
29-
$app->singleton(
30-
Illuminate\Contracts\Http\Kernel::class,
31-
App\Http\Kernel::class,
32-
);
33-
34-
$app->singleton(
35-
Illuminate\Contracts\Console\Kernel::class,
36-
App\Console\Kernel::class,
37-
);
38-
39-
$app->singleton(
40-
Illuminate\Contracts\Debug\ExceptionHandler::class,
41-
App\Exceptions\Handler::class,
42-
);
43-
44-
/*
45-
|--------------------------------------------------------------------------
46-
| Return The Application
47-
|--------------------------------------------------------------------------
48-
|
49-
| This script returns the application instance. The instance is given to
50-
| the calling script so we can separate the building of the instances
51-
| from the actual running of the application and sending responses.
52-
|
53-
*/
54-
55-
return $app;
3+
use Illuminate\Foundation\Application;
4+
use Illuminate\Foundation\Configuration\Exceptions;
5+
use Illuminate\Foundation\Configuration\Middleware;
6+
7+
return Application::configure(basePath: dirname(__DIR__))
8+
->withProviders()
9+
->withRouting(
10+
web: __DIR__.'/../routes/web.php',
11+
// api: __DIR__.'/../routes/api.php',
12+
commands: __DIR__.'/../routes/console.php',
13+
// channels: __DIR__.'/../routes/channels.php',
14+
health: '/up',
15+
)
16+
->withMiddleware(function (Middleware $middleware) {
17+
//
18+
})
19+
->withExceptions(function (Exceptions $exceptions) {
20+
//
21+
})->create();

bootstrap/providers.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
App\Providers\AppServiceProvider::class,
5+
];

0 commit comments

Comments
 (0)