-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[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.
@@ -20,7 +20,7 @@ class OptimizeCommand extends Command | |||
* | |||
* @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
.env
file. TheLoadConfiguration
bootstrap class has been added to support framework configuration cascading. A newconfig:publish
command has been introduced to publish framework configuration files.Middleware
The
Authenticate
middleware andAuthenticationException
exception now haveredirectUsing
methods 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 theMiddleware
application builder class.The
Authenticate
middleware also now does not return a redirect location if the incoming request expected JSON.The
RedirectIfAuthenticated
middleware has been added to the framework. This middleware also includes aredirectUsing
method to customize the “guest” redirection behavior. The default behavior is to redirect to/dashboard
. Helper methods for setting this closure are available on theMiddleware
application builder class.The
AuthenticateSession
middleware has received aredirectUsing
helper to control the redirection behavior. Helper methods for setting this closure are available on theMiddleware
application builder class.The
TrimStrings
middleware has received anexcept
method that may be used to specify which strings should not be trimmed.The
ValidateCsrfToken
middleware has received anexcept
method that may be used to specify which paths should not receive CSRF token validation.The
ValidateSignature
middleware has receive anexcept
method that may be used to specify which parameters should not be included in signature validation.ValidateCsrfToken
has been added as an alias ofVerifyCsrfToken
.The
TrustHosts
middleware has been updated to allow all subdomains of the application’s configured URL by default.The
TrustProxies
middleware has been updated to trust all proxies by default.The
EncryptCookies
middleware has received a staticexcept
method which may be used in a service provider to specify the cookies that should not be encrypted.Events
The foundation
EventServiceProvider
has been updated to discover events by default. In addition, the email verification listener to send email verification notifications is now configured automatically if noRegistered
event listeners exist or theSendEmailVerificatioNotification
listener is not in the list of listeners for theRegistered
event.Notificiations
A
slack
configuration array has been added to the framework's copy of theservices.php
configuration file.Artisan Commands
The
cache:table
command has received amake:cache-table
alias to move all generation commands under themake
namespace. Thenotifications:table
command has receive amake:notifications-table
alias to move all generation commands under themake
namespace. Thequeue:batches-table
command has received amake:queue-batches-table
alias for the same reason as above. Thequeue:failed-table
command has received amake:queue-failed-table
alias for the same reason as above. In addition,queue:table
has received amake:queue-table
alias. Also,session:table
has received amake:session-table
alias.A
schedule
command 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
Schedule
facade.The
optimize
command now also caches views and events.Service Providers
The
RegisterProviders
bootstrap class has been updated to support the loading of additional providers from thebootstrap/providers.php
array file.The
make:provider
command has been updated to add the new service provider to thebootstrap/providers.php
file if it exists.The
ServiceProvider
class has received a new staticaddProviderToBootstrapFile
method that will add a service provider class to thebootstrap/providers.php
file if it exists.Application Configuration
The
Application
class has received several new methods and helpers. A newregistered
listener method has been added to allow code to react to the registration service providers. A newgetBootstrapProvidersPath
method has been added that returns the location to the bootstrap providers file. NewhandleRequest
andhandleCommands
method have been added in order to clean up and simplify the application level bootstrap / index files.A new
configure
method has been added to theApplication
class in order to allow the fluent configuration of multiple framework features, including routing and container bindings.A new
ApplicationBuilder
class 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
Middleware
application 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 likeTrustHosts
andEnsureFrontendRequestsAreStateful
.Helper methods have been added to the exception handler for
dontReport
,dontReportDuplicates
,dontFlash
,buildContextUsing
.Installers
A new
install:api
command has been added. This command installslaravel/sanctum
and uncomments the “API” routes definition in the bootstrap file.A new
install:broadcasting
has been added which uncomments the “channels” routes definition in the bootstrap file. In addition, a Laravel Echo file is written to theresources/js
directory which contains the Echo configuration. A directive to include this file is injected into the mainbootstrap.js
file.