Skip to content

Commit

Permalink
[11.x] Slim skeleton (laravel#6188)
Browse files Browse the repository at this point in the history
See: laravel/framework#47309

# Laravel 11 Skeleton Overview

### General Notes

More environment variables have been added to the `.env.example` file. 

The default `QUEUE_CONNECTION` variable value has been updated to `database` instead of `sync`.

The `BROADCAST_DRIVER` and `CACHE_DRIVER` environment variables have been renamed to `BROADCAST_CONNECTION` and `CACHE_STORE`, respectively.

The HTTP Kernel has been removed. Configuration that was previously done in this file can be done in the `bootstrap/app.php` file, including registering / replacing middleware.

The console kernel has been removed. Schedules can be defined in the console “routes” file. Commands generated by `make:command` are automatically loaded and do not require registration. Additional command loading paths can be registered in the `bootstrap/app.php` file.

The exception handler has been removed. Exception handling behavior can be configured in the `bootstrap/app.php` file via `reportable`, `renderable`, `throttle`, and more. Callbacks received by these functions will have their type hints inspected to see if they handle a given exception.

The base HTTP controller no longer extends any other classes (requiring new middleware definition feature). No traits are included by default on the base controller. Authorization can be done using facades, or traits can be added manually.

All middleware has been removed. Configuration of these middleware’s behavior can be done via static methods on the middleware themselves (see framework notes).

The `User` model now utilizes a `casts` method instead of a property. The `HasApiTokens` trait has been removed by default since Sanctum is not installed by default.

All service providers except the `AppServiceProvider` have been removed. Policies are auto-discovered and gates can be registered in `AppServiceProvider`. Likewise, events can be registered in `AppServiceProvider`. Routing behavior is now determined / customized in the `bootstrap/app.php` file.

New `bootstrap/app.php` file can be used to customize core framework behavior like routing, container bindings, middleware, and exception handling.

Sanctum is no longer installed by default (see `install:api`).

Configuration files are not present by default. Can be published by `config:publish` command. Default values are present in the framework and application level configuration now cascades with framework definitions, so only customized values need be present in application level configuration files.

Migration files have been re-dated to be evergreen. The `password_reset_tokens` table migration has been combined into the `users` table migration file. Likewise, the `jobs` table migration has been combined into a single migration with the `failed_jobs` table.

Echo bootstrapping has been removed by default. It is re-inserted by new `install:broadcasting` command.

API and channel routes files are not present by default, can be recreated by `install:api` and `install:broadcasting` respectively.
  • Loading branch information
taylorotwell authored Nov 28, 2023
1 parent 645e13d commit 428a190
Show file tree
Hide file tree
Showing 51 changed files with 106 additions and 2,182 deletions.
16 changes: 13 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=redis

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

Expand All @@ -15,15 +24,16 @@ DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
BROADCAST_CONNECTION=log
CACHE_STORE=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Expand Down
27 changes: 0 additions & 27 deletions app/Console/Kernel.php

This file was deleted.

30 changes: 0 additions & 30 deletions app/Exceptions/Handler.php

This file was deleted.

8 changes: 2 additions & 6 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
abstract class Controller
{
use AuthorizesRequests, ValidatesRequests;
//
}
68 changes: 0 additions & 68 deletions app/Http/Kernel.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Http/Middleware/Authenticate.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Http/Middleware/EncryptCookies.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Http/Middleware/PreventRequestsDuringMaintenance.php

This file was deleted.

30 changes: 0 additions & 30 deletions app/Http/Middleware/RedirectIfAuthenticated.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Http/Middleware/TrimStrings.php

This file was deleted.

20 changes: 0 additions & 20 deletions app/Http/Middleware/TrustHosts.php

This file was deleted.

28 changes: 0 additions & 28 deletions app/Http/Middleware/TrustProxies.php

This file was deleted.

22 changes: 0 additions & 22 deletions app/Http/Middleware/ValidateSignature.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Http/Middleware/VerifyCsrfToken.php

This file was deleted.

Loading

0 comments on commit 428a190

Please sign in to comment.