Skip to content

Commit e25b16b

Browse files
authored
Laravel 7.x (#55)
* enhance: Update packages to Illuminate 7.x (Fixes #54) * chore: Bump minimum PHP version to 7.2.5 * enhance(exceptions): Update HandleExceptions to Symfony 5 * enhance(helpers): Add new Laravel 7.x helpers * chore(helpers): Sort helpers alphabetically * chore(helpers): Remove unused helpers * chore(globals): Update globals to reflect helpers * chore(config): Update default configs to be in parity with Sage 10 * feat(blade): Add Laravel 7.x Blade component support * feat(console): Add make:component command for generating a component class and view * feat(console): Add stubs for a component class and view * chore(console): Clean up existing console commands * chore: Remove unused namespaces throughout project * chore(deps): Bump dependencies
1 parent 05fee42 commit e25b16b

33 files changed

+771
-519
lines changed

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535
}
3636
},
3737
"require": {
38-
"php": "^7.2",
39-
"illuminate/cache": "^6.8",
40-
"illuminate/config": "^6.8",
41-
"illuminate/console": "^6.8",
42-
"illuminate/container": "^6.8",
43-
"illuminate/contracts": "^6.8",
44-
"illuminate/events": "^6.8",
45-
"illuminate/filesystem": "^6.8",
46-
"illuminate/log": "^6.8",
47-
"illuminate/support": "^6.8",
48-
"illuminate/view": "^6.8",
38+
"php": "^7.2.5",
39+
"illuminate/cache": "^7.0",
40+
"illuminate/config": "^7.0",
41+
"illuminate/console": "^7.0",
42+
"illuminate/container": "^7.0",
43+
"illuminate/contracts": "^7.0",
44+
"illuminate/events": "^7.0",
45+
"illuminate/filesystem": "^7.0",
46+
"illuminate/log": "^7.0",
47+
"illuminate/support": "^7.0",
48+
"illuminate/view": "^7.0",
4949
"league/flysystem": "^1.0",
5050
"roots/support": "dev-master",
5151
"symfony/var-dumper": "^5.0"

config/app.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
|
6868
*/
6969

70-
'preflight' => false,
70+
'preflight' => env('WP_ENV', 'production') !== 'production',
7171

7272
/*
7373
|--------------------------------------------------------------------------
@@ -120,13 +120,20 @@
120120
*/
121121

122122
'providers' => [
123+
/**
124+
* Package Service Providers
125+
*/
126+
// ExamplePackage\Providers\ExamplePackageServiceProvider::class,
127+
128+
/**
129+
* Application Service Providers
130+
*/
123131
// App\Providers\AppServiceProvider::class,
124-
// App\SomeService\SomeServiceServiceProvider::class,
125132
],
126133

127134
/*
128135
|--------------------------------------------------------------------------
129-
| Class Aliases (formerly "Facades")
136+
| Class Aliases
130137
|--------------------------------------------------------------------------
131138
|
132139
| This array of class aliases will be registered when this application
@@ -137,6 +144,7 @@
137144

138145
'aliases' => [
139146
'App' => Illuminate\Support\Facades\App::class,
147+
'Arr' => Illuminate\Support\Arr::class,
140148
'Artisan' => Illuminate\Support\Facades\Artisan::class,
141149
'Auth' => Illuminate\Support\Facades\Auth::class,
142150
'Blade' => Illuminate\Support\Facades\Blade::class,
@@ -152,6 +160,7 @@
152160
'File' => Illuminate\Support\Facades\File::class,
153161
'Gate' => Illuminate\Support\Facades\Gate::class,
154162
'Hash' => Illuminate\Support\Facades\Hash::class,
163+
'Http' => Illuminate\Support\Facades\Http::class,
155164
'Lang' => Illuminate\Support\Facades\Lang::class,
156165
'Log' => Illuminate\Support\Facades\Log::class,
157166
'Mail' => Illuminate\Support\Facades\Mail::class,
@@ -166,6 +175,7 @@
166175
'Schema' => Illuminate\Support\Facades\Schema::class,
167176
'Session' => Illuminate\Support\Facades\Session::class,
168177
'Storage' => Illuminate\Support\Facades\Storage::class,
178+
'Str' => Illuminate\Support\Str::class,
169179
'URL' => Illuminate\Support\Facades\URL::class,
170180
'Validator' => Illuminate\Support\Facades\Validator::class,
171181
'View' => Illuminate\Support\Facades\View::class,

config/assets.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
'strategy' => 'relative',
3737
'path' => get_theme_file_path('/dist'),
3838
'uri' => get_theme_file_uri('/dist'),
39-
'manifest' => get_theme_file_path('/dist/assets.json'),
40-
],
41-
],
39+
'manifest' => get_theme_file_path('/dist/mix-manifest.json'),
40+
]
41+
]
4242
];

config/cache.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242

4343
'array' => [
4444
'driver' => 'array',
45+
'serialize' => false,
4546
],
4647

4748
'database' => [
48-
'driver' => 'mysql',
49+
'driver' => 'database',
4950
'table' => 'cache',
5051
'connection' => null,
5152
],
@@ -87,7 +88,6 @@
8788
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
8889
'endpoint' => env('DYNAMODB_ENDPOINT'),
8990
],
90-
9191
],
9292

9393
/*
@@ -102,4 +102,5 @@
102102
*/
103103

104104
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', wp_get_theme()->get('Name')), '_') . '_cache'),
105+
105106
];

config/database.php

Lines changed: 87 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use function Roots\env;
3+
use Illuminate\Support\Str;
44

55
return [
66

@@ -24,30 +24,70 @@
2424
|
2525
| Here are each of the database connections setup for your application.
2626
| Of course, examples of configuring each database platform that is
27-
| supported by Acorn is shown below to make development simple.
27+
| supported by Laravel is shown below to make development simple.
2828
|
2929
|
30-
| All database work in Acorn is done through the PHP PDO facilities
30+
| All database work in Laravel is done through the PHP PDO facilities
3131
| so make sure you have the driver for your particular database of
3232
| choice installed on your machine before you begin development.
3333
|
3434
*/
3535

3636
'connections' => [
37+
'sqlite' => [
38+
'driver' => 'sqlite',
39+
'url' => env('DATABASE_URL'),
40+
'database' => env('DB_DATABASE', database_path('database.sqlite')),
41+
'prefix' => '',
42+
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
43+
],
44+
3745
'mysql' => [
3846
'driver' => 'mysql',
39-
'host' => env('DB_HOST', defined('DB_HOST') ? DB_HOST : 'localhost'),
40-
'port' => env('DB_PORT', defined('DB_PORT') ? DB_PORT : '3306'),
41-
'database' => env('DB_NAME', defined('DB_NAME') ? DB_NAME : 'wordpress'),
42-
'username' => env('DB_USER', defined('DB_USER') ? DB_USER : 'wordpress'),
43-
'password' => env('DB_PASSWORD', defined('DB_PASSWORD') ? DB_PASSWORD : ''),
47+
'url' => env('DATABASE_URL'),
48+
'host' => env('DB_HOST', '127.0.0.1'),
49+
'port' => env('DB_PORT', '3306'),
50+
'database' => env('DB_DATABASE', 'forge'),
51+
'username' => env('DB_USERNAME', 'forge'),
52+
'password' => env('DB_PASSWORD', ''),
4453
'unix_socket' => env('DB_SOCKET', ''),
45-
'charset' => env('DB_CHARSET', defined('DB_CHARSET') ? DB_CHARSET : 'utf8mb4'),
46-
'collation' => env('DB_COLLATE', defined('DB_COLLATE') ? DB_COLLATE : 'utf8mb4_unicode_ci'),
47-
'prefix' => env('DB_PREFIX', $GLOBALS['table_prefix'] ?? 'wp_'),
54+
'charset' => 'utf8mb4',
55+
'collation' => 'utf8mb4_unicode_ci',
56+
'prefix' => '',
4857
'prefix_indexes' => true,
4958
'strict' => true,
5059
'engine' => null,
60+
'options' => extension_loaded('pdo_mysql') ? array_filter([
61+
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
62+
]) : [],
63+
],
64+
65+
'pgsql' => [
66+
'driver' => 'pgsql',
67+
'url' => env('DATABASE_URL'),
68+
'host' => env('DB_HOST', '127.0.0.1'),
69+
'port' => env('DB_PORT', '5432'),
70+
'database' => env('DB_DATABASE', 'forge'),
71+
'username' => env('DB_USERNAME', 'forge'),
72+
'password' => env('DB_PASSWORD', ''),
73+
'charset' => 'utf8',
74+
'prefix' => '',
75+
'prefix_indexes' => true,
76+
'schema' => 'public',
77+
'sslmode' => 'prefer',
78+
],
79+
80+
'sqlsrv' => [
81+
'driver' => 'sqlsrv',
82+
'url' => env('DATABASE_URL'),
83+
'host' => env('DB_HOST', 'localhost'),
84+
'port' => env('DB_PORT', '1433'),
85+
'database' => env('DB_DATABASE', 'forge'),
86+
'username' => env('DB_USERNAME', 'forge'),
87+
'password' => env('DB_PASSWORD', ''),
88+
'charset' => 'utf8',
89+
'prefix' => '',
90+
'prefix_indexes' => true,
5191
],
5292
],
5393

@@ -63,4 +103,40 @@
63103
*/
64104

65105
'migrations' => 'migrations',
106+
107+
/*
108+
|--------------------------------------------------------------------------
109+
| Redis Databases
110+
|--------------------------------------------------------------------------
111+
|
112+
| Redis is an open source, fast, and advanced key-value store that also
113+
| provides a richer body of commands than a typical key-value system
114+
| such as APC or Memcached. Laravel makes it easy to dig right in.
115+
|
116+
*/
117+
118+
'redis' => [
119+
'client' => env('REDIS_CLIENT', 'phpredis'),
120+
121+
'options' => [
122+
'cluster' => env('REDIS_CLUSTER', 'redis'),
123+
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
124+
],
125+
126+
'default' => [
127+
'url' => env('REDIS_URL'),
128+
'host' => env('REDIS_HOST', '127.0.0.1'),
129+
'password' => env('REDIS_PASSWORD', null),
130+
'port' => env('REDIS_PORT', '6379'),
131+
'database' => env('REDIS_DB', '0'),
132+
],
133+
134+
'cache' => [
135+
'url' => env('REDIS_URL'),
136+
'host' => env('REDIS_HOST', '127.0.0.1'),
137+
'password' => env('REDIS_PASSWORD', null),
138+
'port' => env('REDIS_PORT', '6379'),
139+
'database' => env('REDIS_CACHE_DB', '1'),
140+
],
141+
],
66142
];

config/filesystems.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
| Default Filesystem Disk
1010
|--------------------------------------------------------------------------
1111
|
12-
| Here you may specify the default filesystem disk that should be used.
13-
| The "local" disk, as well as a variety of cloud-based disks are
14-
| available to your application. Just store away!
12+
| Here you may specify the default filesystem disk that should be used
13+
| by the framework. The "local" disk, as well as a variety of cloud
14+
| based disks are available to your application. Just store away!
1515
|
1616
*/
1717

@@ -39,7 +39,7 @@
3939
| may even configure multiple disks of the same driver. Defaults have
4040
| been setup for each driver as an example of the required options.
4141
|
42-
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
42+
| Supported Drivers: "local", "ftp", "sftp", "s3"
4343
|
4444
*/
4545

@@ -58,13 +58,6 @@
5858
'visibility' => 'public',
5959
],
6060

61-
'theme' => [
62-
'driver' => 'local',
63-
'root' => STYLESHEETPATH,
64-
'url' => get_stylesheet_directory_uri(),
65-
'visibility' => 'public',
66-
],
67-
6861
's3' => [
6962
'driver' => 's3',
7063
'key' => env('AWS_ACCESS_KEY_ID'),

config/hashing.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
use function Roots\env;
4+
5+
return [
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Default Hash Driver
10+
|--------------------------------------------------------------------------
11+
|
12+
| This option controls the default hash driver that will be used to hash
13+
| passwords for your application. By default, the bcrypt algorithm is
14+
| used; however, you remain free to modify this option if you wish.
15+
|
16+
| Supported: "bcrypt", "argon", "argon2id"
17+
|
18+
*/
19+
20+
'driver' => 'bcrypt',
21+
22+
/*
23+
|--------------------------------------------------------------------------
24+
| Bcrypt Options
25+
|--------------------------------------------------------------------------
26+
|
27+
| Here you may specify the configuration options that should be used when
28+
| passwords are hashed using the Bcrypt algorithm. This will allow you
29+
| to control the amount of time it takes to hash the given password.
30+
|
31+
*/
32+
33+
'bcrypt' => [
34+
'rounds' => env('BCRYPT_ROUNDS', 10),
35+
],
36+
37+
/*
38+
|--------------------------------------------------------------------------
39+
| Argon Options
40+
|--------------------------------------------------------------------------
41+
|
42+
| Here you may specify the configuration options that should be used when
43+
| passwords are hashed using the Argon algorithm. These will allow you
44+
| to control the amount of time it takes to hash the given password.
45+
|
46+
*/
47+
48+
'argon' => [
49+
'memory' => 1024,
50+
'threads' => 2,
51+
'time' => 2,
52+
],
53+
54+
];

config/logging.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Monolog\Handler\NullHandler;
34
use Monolog\Handler\StreamHandler;
45
use Monolog\Handler\SyslogUdpHandler;
56

@@ -27,7 +28,7 @@
2728
|--------------------------------------------------------------------------
2829
|
2930
| Here you may configure the log channels for your application. Out of
30-
| the box, Acorn uses the Monolog PHP logging library. This gives
31+
| the box, the framework uses the Monolog PHP logging library. This gives
3132
| you a variety of powerful log handlers / formatters to utilize.
3233
|
3334
| Available Drivers: "single", "daily", "slack", "syslog",
@@ -39,7 +40,7 @@
3940
'channels' => [
4041
'stack' => [
4142
'driver' => 'stack',
42-
'channels' => ['daily'],
43+
'channels' => ['single'],
4344
'ignore_exceptions' => false,
4445
],
4546

@@ -59,7 +60,7 @@
5960
'slack' => [
6061
'driver' => 'slack',
6162
'url' => env('LOG_SLACK_WEBHOOK_URL'),
62-
'username' => 'Sage Log',
63+
'username' => 'App Log',
6364
'emoji' => ':boom:',
6465
'level' => 'critical',
6566
],
@@ -92,5 +93,14 @@
9293
'driver' => 'errorlog',
9394
'level' => 'debug',
9495
],
96+
97+
'null' => [
98+
'driver' => 'monolog',
99+
'handler' => NullHandler::class,
100+
],
101+
102+
'emergency' => [
103+
'path' => storage_path('logs/app.log'),
104+
],
95105
],
96106
];

0 commit comments

Comments
 (0)