-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[11.x] Slim skeleton #47309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Slim skeleton #47309
Conversation
31ad284 to
82067b6
Compare
ab3c1b8 to
7e39af5
Compare
20b4291 to
a44ebbd
Compare
403ab9f to
b5299bb
Compare
b5299bb to
b0ea428
Compare
b0ea428 to
473adaa
Compare
05ae303 to
24a2473
Compare
17afb52 to
f99a90f
Compare
b70ebc8 to
d8f44e3
Compare
d8f44e3 to
55513c9
Compare
55513c9 to
ae53dbc
Compare
| * Begin configuring a new Laravel application instance. | ||
| * | ||
| * @param string|null $baseDirectory | ||
| * @return \Illuminate\Foundation\ApplicationBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @return \Illuminate\Foundation\ApplicationBuilder | |
| * @return \Illuminate\Foundation\Configuration\ApplicationBuilder |
| public static function configure(string $baseDirectory = null) | ||
| { | ||
| $baseDirectory = $ENV['APP_BASE_PATH'] ?? ($baseDirectory ?: dirname(dirname( | ||
| debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1)[0]['file'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can use Composer's runtime classes to grab this directory, so we don't have to use the backtrace here.
| */ | ||
| public static function configure(string $baseDirectory = null) | ||
| { | ||
| $baseDirectory = $ENV['APP_BASE_PATH'] ?? ($baseDirectory ?: dirname(dirname( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use dirname($path, 2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels that this should be the other way around, so: $baseDirectory > ENV > reflection...
| if (! isset($files['app'])) { | ||
| throw new Exception('Unable to load the "app" configuration file.'); | ||
| // if (! isset($files['app'])) { | ||
| // throw new Exception('Unable to load the "app" configuration file.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear for me this commented code.
| * @var string | ||
| */ | ||
| protected $description = 'Cache the framework bootstrap files'; | ||
| protected $description = 'Cache framework bootstrap, configuration, and metadata to increase performance'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should come up with a new command name to avoid this BC.
| * | ||
| * @var array | ||
| */ | ||
| protected $aliases = ['notifications:table']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably mark all these aliases as @deprecated. cc @driesvints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nunomaduro agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm on second thought this could maybe not hurt. People have been used to these command names for a while. Maybe it's best we support them indefinitely?
…ds (#48137) * Adds `Artisan::command()->schedule(...)` * Apply fixes from StyleCI * formatting --------- Co-authored-by: StyleCI Bot <bot@styleci.io> Co-authored-by: Taylor Otwell <taylor@laravel.com>
* Add MariaDB to databases config and Change MySQL 8 collation * Update tests workflow for MariaDB * Update default collation for mariadb
…49110) Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
* Test Improvements Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> * Fix MariaDB Tests with changed query * Fix Testbench version * Allow to override collation using DB_COLLATION Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> * wip Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> --------- Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> Co-authored-by: Julius Kiekbusch <contact@julius-kiekbusch.de>
7f6c54f to
e0249d3
Compare
laravel/laravel#6188
Laravel 11 Framework Overview
Configuration
All configuration files now have framework counterparts and application level configuration is merged with the framework defaults. The default configuration files have also received many more environment variables so that more options can be changed from the application’s
.envfile. TheLoadConfigurationbootstrap class has been added to support framework configuration cascading. A newconfig:publishcommand has been introduced to publish framework configuration files.Middleware
The
Authenticatemiddleware andAuthenticationExceptionexception now haveredirectUsingmethods that accept a closure. This closure will be invoked to determine where to redirect unauthenticated users. Helper methods for setting this closure are available on theMiddlewareapplication builder class.The
Authenticatemiddleware also now does not return a redirect location if the incoming request expected JSON.The
RedirectIfAuthenticatedmiddleware has been added to the framework. This middleware also includes aredirectUsingmethod to customize the “guest” redirection behavior. The default behavior is to redirect to/dashboard. Helper methods for setting this closure are available on theMiddlewareapplication builder class.The
AuthenticateSessionmiddleware has received aredirectUsinghelper to control the redirection behavior. Helper methods for setting this closure are available on theMiddlewareapplication builder class.The
TrimStringsmiddleware has received anexceptmethod that may be used to specify which strings should not be trimmed.The
ValidateCsrfTokenmiddleware has received anexceptmethod that may be used to specify which paths should not receive CSRF token validation.The
ValidateSignaturemiddleware has receive anexceptmethod that may be used to specify which parameters should not be included in signature validation.ValidateCsrfTokenhas been added as an alias ofVerifyCsrfToken.The
TrustHostsmiddleware has been updated to allow all subdomains of the application’s configured URL by default.The
TrustProxiesmiddleware has been updated to trust all proxies by default.The
EncryptCookiesmiddleware has received a staticexceptmethod which may be used in a service provider to specify the cookies that should not be encrypted.Events
The foundation
EventServiceProviderhas been updated to discover events by default. In addition, the email verification listener to send email verification notifications is now configured automatically if noRegisteredevent listeners exist or theSendEmailVerificatioNotificationlistener is not in the list of listeners for theRegisteredevent.Notificiations
A
slackconfiguration array has been added to the framework's copy of theservices.phpconfiguration file.Artisan Commands
The
cache:tablecommand has received amake:cache-tablealias to move all generation commands under themakenamespace. Thenotifications:tablecommand has receive amake:notifications-tablealias to move all generation commands under themakenamespace. Thequeue:batches-tablecommand has received amake:queue-batches-tablealias for the same reason as above. Thequeue:failed-tablecommand has received amake:queue-failed-tablealias for the same reason as above. In addition,queue:tablehas received amake:queue-tablealias. Also,session:tablehas received amake:session-tablealias.A
schedulecommand has been added to closure commands, allowing the fluent scheduling of closure commands in the console routes file.The console scheduler is now available via a
Schedulefacade.The
optimizecommand now also caches views and events.Service Providers
The
RegisterProvidersbootstrap class has been updated to support the loading of additional providers from thebootstrap/providers.phparray file.The
make:providercommand has been updated to add the new service provider to thebootstrap/providers.phpfile if it exists.The
ServiceProviderclass has received a new staticaddProviderToBootstrapFilemethod that will add a service provider class to thebootstrap/providers.phpfile if it exists.Application Configuration
The
Applicationclass has received several new methods and helpers. A newregisteredlistener method has been added to allow code to react to the registration service providers. A newgetBootstrapProvidersPathmethod has been added that returns the location to the bootstrap providers file. NewhandleRequestandhandleCommandsmethod have been added in order to clean up and simplify the application level bootstrap / index files.A new
configuremethod has been added to theApplicationclass in order to allow the fluent configuration of multiple framework features, including routing and container bindings.A new
ApplicationBuilderclass has been introduced to allow the easy configuration of a variety of core framework functionality, including routing, commands, middleware, exception handling, booting / booted callbacks, and more.A new
Middlewareapplication configuration class has been introduced that allows the easy definition of new middleware groups, prepending and appending of middleware to existing groups, replacing middleware in existing groups, and fluent methods for enabling middleware likeTrustHostsandEnsureFrontendRequestsAreStateful.Helper methods have been added to the exception handler for
dontReport,dontReportDuplicates,dontFlash,buildContextUsing.Installers
A new
install:apicommand has been added. This command installslaravel/sanctumand uncomments the “API” routes definition in the bootstrap file.A new
install:broadcastinghas been added which uncomments the “channels” routes definition in the bootstrap file. In addition, a Laravel Echo file is written to theresources/jsdirectory which contains the Echo configuration. A directive to include this file is injected into the mainbootstrap.jsfile.