Skip to content

[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

Merged
merged 120 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
295d630
allow web and api named args on routes method
taylorotwell Apr 11, 2023
70a0316
add app skeleton broadcast provider in core
taylorotwell Apr 12, 2023
2a66636
fix conflicts
taylorotwell May 11, 2023
e2db75b
Apply fixes from StyleCI
StyleCIBot Apr 14, 2023
b5f0e34
revert route provider change
taylorotwell Apr 14, 2023
0e73da5
auto register email verification listener
taylorotwell Apr 18, 2023
9f1b321
add base middleware for guest, dont use redirect to on json requests …
taylorotwell Apr 20, 2023
ef96e91
trust proxies by default
taylorotwell Apr 20, 2023
2c4e4f9
update trust hosts with good defaults - not abstract anymore
taylorotwell Apr 20, 2023
33ecb9a
move middleware into http component
taylorotwell Apr 21, 2023
f1874a5
alias csrf token middleware for naming consistency
taylorotwell Apr 21, 2023
5e2e2c9
load default app command path automatically if it's not explicitly lo…
taylorotwell Apr 21, 2023
6429b59
add command discovery hook
taylorotwell Apr 21, 2023
64f32a0
add cleaner bootstrap methods
taylorotwell May 5, 2023
ef0d95c
clean up logic on base directories
taylorotwell May 5, 2023
7c56f25
allow an exception handling callback
taylorotwell May 5, 2023
f68c0aa
add methods for ignoring trim strings, encrypt cookies, and flash data
taylorotwell May 8, 2023
35330e6
add dontReport method to exception handler
taylorotwell May 10, 2023
878d668
add test for global csrf exceptions
taylorotwell May 10, 2023
c077a18
add tests for trim strings, encrypt cookies, and csrf global excepts
taylorotwell May 10, 2023
4f3c724
make properties protected. adjust tests
taylorotwell May 10, 2023
46451e1
add global except to signature validation
taylorotwell May 11, 2023
6f9407c
Apply fixes from StyleCI
StyleCIBot May 11, 2023
bf7d5b2
change method order
taylorotwell May 11, 2023
bef8347
add broadcasting support method
taylorotwell May 12, 2023
495fa37
make event service provider discover by default if not extended
taylorotwell May 13, 2023
1bf8065
add with events method to auto register event service provider
taylorotwell May 17, 2023
fa7c178
add methods for provider additions
taylorotwell May 17, 2023
e9bcf56
update routing to be handled during bootstrapping
taylorotwell May 17, 2023
285969e
change how schedule is defined in container - add facade
taylorotwell May 19, 2023
21041d5
extract method
taylorotwell May 19, 2023
4acb5c7
bind core console kernel in container
taylorotwell May 19, 2023
6e44593
fix command loading
taylorotwell May 19, 2023
ecf44ab
tweak command loading
taylorotwell May 19, 2023
1d1e2b0
add app builder
taylorotwell May 21, 2023
e36deba
allow api prefix
taylorotwell May 21, 2023
6d1b188
add routing callback
taylorotwell May 21, 2023
93ac31a
make http kernel no longer necessary
taylorotwell May 21, 2023
c7282db
allow further middleware customization
taylorotwell May 21, 2023
9aa5bef
add methods to middleware configuration class
taylorotwell May 25, 2023
60034bd
add easy methods for handling requests and artisan commands
taylorotwell May 25, 2023
c804840
Apply fixes from StyleCI
StyleCIBot Jun 2, 2023
1f4aff7
Update facade docblocks
taylorotwell Jun 2, 2023
f98904d
allow the removal of middleware
taylorotwell Jun 5, 2023
d358fbd
allow middleware replacements
taylorotwell Jun 5, 2023
9bdac66
add binding methods
taylorotwell Jun 5, 2023
5d19f54
allow additional artisan commands to be registered
taylorotwell Jun 5, 2023
8ab7c86
allow for additional command directory registration
taylorotwell Jun 5, 2023
b31c613
Update facade docblocks
taylorotwell Jun 5, 2023
6ac5cd4
allow channels in routing
taylorotwell Jun 5, 2023
a5d0600
register command routes
taylorotwell Jun 5, 2023
b6c668b
Update facade docblocks
taylorotwell Jun 5, 2023
132954d
remove unnecessary code
taylorotwell Jun 6, 2023
05ed259
make withCommands support paths and commands
taylorotwell Jun 6, 2023
67dd288
initial stub of exceptions
taylorotwell Jun 6, 2023
697cfb7
add exception handling proxy
taylorotwell Jun 6, 2023
0911489
support files on command
taylorotwell Jun 6, 2023
946b893
adjust how commands are registered
taylorotwell Jun 6, 2023
ac5de74
slim exception method
taylorotwell Jun 6, 2023
1168c10
Update facade docblocks
taylorotwell Jun 6, 2023
de3a25d
add types
taylorotwell Jun 6, 2023
9612d2b
add precog
taylorotwell Jun 7, 2023
c99e7ec
simplify methods
taylorotwell Jun 7, 2023
1c2c7d4
allow redirects for various middleware to be configured statically
taylorotwell Jun 7, 2023
ef7eed3
add more middleware helpers
taylorotwell Jun 7, 2023
90e0a25
allow redis throttling
taylorotwell Jun 7, 2023
a57a021
allow total group override and global override
taylorotwell Jun 7, 2023
37421cf
rename method
taylorotwell Jun 7, 2023
b307fc4
rename variable
taylorotwell Jun 7, 2023
313aca2
allow configuration file publishing and base values
taylorotwell Jun 12, 2023
972d3af
remove sanctum config
taylorotwell Jun 12, 2023
8eac2a5
add more env variables
taylorotwell Jun 12, 2023
317b981
env var consistency
taylorotwell Jun 12, 2023
edcb087
continue work on config
taylorotwell Jun 12, 2023
f6dbbe2
use array_merge
taylorotwell Jun 12, 2023
fd70791
fix order of merge
taylorotwell Jun 12, 2023
8317341
support slimmer provider configuration
taylorotwell Jun 21, 2023
d5efae9
work on slim providers
taylorotwell Jun 21, 2023
845df53
work on slim providers
taylorotwell Jun 21, 2023
d551579
work on slim provider
taylorotwell Jun 21, 2023
743bba1
dry up code
taylorotwell Jun 21, 2023
9fbcaff
slim providers
taylorotwell Jun 21, 2023
1c60d3b
use is_string check
taylorotwell Jun 21, 2023
d831958
refactor code
taylorotwell Jun 21, 2023
0e651d6
extract method
taylorotwell Jun 21, 2023
1d85912
comment
taylorotwell Jun 21, 2023
47b3553
method extraction
taylorotwell Jun 21, 2023
5e8719d
rename variables
taylorotwell Jun 21, 2023
6e137e4
check realpath on routes
taylorotwell Jun 21, 2023
ae65484
Apply fixes from StyleCI
StyleCIBot Jun 30, 2023
978ec66
Update facade docblocks
taylorotwell Jun 30, 2023
5e40d0c
unify generator command names and add aliases
taylorotwell Jun 30, 2023
25cbee6
sort published config files
taylorotwell Jun 30, 2023
c2de0f2
add make:api command
taylorotwell Jul 1, 2023
7eea98d
rename to install command
taylorotwell Jul 1, 2023
716908b
add install:broadcasting command
taylorotwell Jul 1, 2023
024c6e6
use object based middleware
taylorotwell Jul 1, 2023
3b2d03c
add message to install:api command
taylorotwell Jul 7, 2023
017f37a
vendor publish sanctum files
taylorotwell Jul 7, 2023
244411b
let broadcasting command install necessary files
taylorotwell Jul 7, 2023
6c1fa10
remove commented code
taylorotwell Jul 7, 2023
18bfce4
comments
taylorotwell Jul 7, 2023
5b1aea0
Apply fixes from StyleCI
StyleCIBot Jul 11, 2023
1af5da9
extract method
taylorotwell Jul 14, 2023
c1fe683
formatting - folio support
taylorotwell Jul 14, 2023
05b9db1
handle model not found in view
taylorotwell Jul 14, 2023
ec4e5d1
[slim-skeleton-11.x] Adds `Artisan::command(...)->...` schedule metho…
nunomaduro Aug 25, 2023
cb3f342
install dev-master of sanctum
taylorotwell Aug 30, 2023
f401d62
update sanctum configuration
taylorotwell Aug 31, 2023
5676bfb
add dontReportDuplicates
taylorotwell Sep 6, 2023
731b51f
[11.x] Add mariadb to databases config (#48455)
Jubeki Nov 8, 2023
f15c2e8
remove sanctum config as it is installed by install:api
taylorotwell Nov 17, 2023
7356033
allow throttling of exceptions
taylorotwell Nov 17, 2023
c312ee9
update optimize to cache views and events
taylorotwell Nov 17, 2023
091e150
make route uncommenting and adding a bit less brittle
taylorotwell Nov 17, 2023
45ca2b8
Removes unused `?: new ArgvInput` (#49052)
nunomaduro Nov 20, 2023
9bbd050
add slack config
taylorotwell Nov 20, 2023
6fde4a4
[11.x] Fixes missing configuration available in latest Laravel 10. (#…
crynobone Nov 24, 2023
fbe8368
[slim-skeleton-11.x] Test Improvements (#49111)
crynobone Nov 24, 2023
e0249d3
Adds `frontend_url` to `app.php` (#49118)
nunomaduro Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
env:
DB_CONNECTION: mysql
DB_USERNAME: root
MYSQL_COLLATION: utf8mb4_unicode_ci

mysql_8:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
- name: Execute tests
run: vendor/bin/phpunit tests/Integration/Database
env:
DB_CONNECTION: mysql
DB_CONNECTION: mariadb
DB_USERNAME: root

pgsql:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
"nyholm/psr7": "^1.2",
"orchestra/testbench-core": "^9.0",
"orchestra/testbench-core": "dev-next/slim-skeleton",
"pda/pheanstalk": "^4.0",
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^10.1",
Expand Down
184 changes: 184 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<?php

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;

return [

/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/

'name' => env('APP_NAME', 'Laravel'),

/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/

'env' => env('APP_ENV', 'production'),

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => (bool) env('APP_DEBUG', false),

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => env('APP_URL', 'http://localhost'),

'frontend_url' => env('FRONTEND_URL', 'http://localhost:3000'),

'asset_url' => env('ASSET_URL'),

/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/

'timezone' => env('APP_TIMEZONE', 'UTC'),

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/

'locale' => env('APP_LOCALE', 'en'),

/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the default one
| is not available. You may change the value to correspond to any of
| the languages which are currently supported by your application.
|
*/

'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),

/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/

'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string or all of the encrypted strings are
| not secure. You should do this prior to deploying the application.
|
*/

'key' => env('APP_KEY'),

'cipher' => 'AES-256-CBC',

/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/

'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'redis'),
],

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on any
| requests to your application. You may add your own services to the
| arrays below to provide additional features to this application.
|
*/

'providers' => ServiceProvider::defaultProviders()->merge([
// Package Service Providers...
])->merge([
// Application Service Providers...
// App\Providers\AppServiceProvider::class,
])->merge([
// Added Service Providers (Do not remove this line)...
])->toArray(),

/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. You may add any additional class aliases which should
| be loaded to the array. For speed, all aliases are lazy loaded.
|
*/

'aliases' => Facade::defaultAliases()->merge([
// 'Example' => App\Facades\Example::class,
])->toArray(),

];
115 changes: 115 additions & 0 deletions config/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/

'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => 'users',
],

/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/

'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],

/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/

'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],

// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],

/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/

'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
],

/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/

'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),

];
71 changes: 71 additions & 0 deletions config/broadcasting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/

'default' => env('BROADCAST_CONNECTION', 'null'),

/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/

'connections' => [

'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],

'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],

'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_BROADCASTING_CONNECTION', 'default'),
],

'log' => [
'driver' => 'log',
],

'null' => [
'driver' => 'null',
],

],

];
Loading