Skip to content

Commit 345ac83

Browse files
committed
L9
1 parent 3f87adc commit 345ac83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1791
-1444
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PASSPORT_REFRESH_TOKEN_EXPIRE_DAYS=30
2424

2525
BROADCAST_DRIVER=pusher
2626
CACHE_DRIVER=redis
27-
FILESYSTEM_DRIVER=local
27+
FILESYSTEM_DISK=local
2828
QUEUE_CONNECTION=sync
2929
SESSION_DRIVER=redis
3030
SESSION_LIFETIME=120
@@ -122,3 +122,5 @@ MIX_STRIPE_KEY="${STRIPE_KEY}"
122122

123123
#DISCORD_TOKEN=
124124
#DISCORD_GUILD_ID=
125+
126+
MONEY_DEFAULTS_CURRENCY=GBP

.gitattributes

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
* text=auto
2-
*.css linguist-vendored
3-
*.scss linguist-vendored
4-
*.js linguist-vendored
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
510
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
### Laravel ###
22
/node_modules
3+
/public/build
34
/public/hot
45
/public/storage
56
/storage/*.key
6-
/public/build
77
/vendor
8-
/.idea
9-
/.vscode
10-
/.vagrant*
8+
.env
9+
.env.backup
10+
.env.production
11+
.phpunit.result.cache
1112
Homestead.json
1213
Homestead.yaml
14+
auth.json
1315
npm-debug.log
1416
yarn-error.log
15-
.env
16-
.env.backup
17-
database/database.sqlite
18-
.phpunit.result.cache
17+
/.fleet
18+
/.idea
19+
/.vscode
1920

2021
### OS generated files ###
2122
.DS_Store
@@ -27,6 +28,7 @@ Icon?
2728
ehthumbs.db
2829
Thumbs.db
2930

31+
/.vagrant*
3032
/public/css
3133
/public/js
3234
/public/fonts/vendor

app/Exceptions/Handler.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,26 @@
1212

1313
class Handler extends ExceptionHandler
1414
{
15+
/**
16+
* A list of exception types with their corresponding custom log levels.
17+
*
18+
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
19+
*/
20+
protected $levels = [
21+
//
22+
];
23+
1524
/**
1625
* A list of the exception types that are not reported.
1726
*
18-
* @var array<int, class-string<Throwable>>
27+
* @var array<int, class-string<\Throwable>>
1928
*/
2029
protected $dontReport = [
2130
//
2231
];
2332

2433
/**
25-
* A list of the inputs that are never flashed for validation exceptions.
34+
* A list of the inputs that are never flashed to the session on validation exceptions.
2635
*
2736
* @var array<int, string>
2837
*/

app/Http/Kernel.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Kernel extends HttpKernel
1616
protected $middleware = [
1717
// \App\Http\Middleware\TrustHosts::class,
1818
\App\Http\Middleware\TrustProxies::class,
19-
\Fruitcake\Cors\HandleCors::class,
19+
\Illuminate\Http\Middleware\HandleCors::class,
2020
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
2121
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2222
\App\Http\Middleware\TrimStrings::class,
@@ -33,14 +33,15 @@ class Kernel extends HttpKernel
3333
\App\Http\Middleware\EncryptCookies::class,
3434
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
3535
\Illuminate\Session\Middleware\StartSession::class,
36-
// \Illuminate\Session\Middleware\AuthenticateSession::class,
3736
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
3837
\App\Http\Middleware\VerifyCsrfToken::class,
38+
// \Illuminate\Routing\Middleware\SubstituteBindings::class,
3939
\LaravelDoctrine\ORM\Middleware\SubstituteBindings::class,
4040
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
4141
],
4242

4343
'api' => [
44+
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
4445
'throttle:api',
4546
\Illuminate\Routing\Middleware\SubstituteBindings::class,
4647
\LaravelDoctrine\ORM\Middleware\SubstituteBindings::class,
@@ -57,11 +58,12 @@ class Kernel extends HttpKernel
5758
protected $routeMiddleware = [
5859
'auth' => \App\Http\Middleware\Authenticate::class,
5960
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
61+
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
6062
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
6163
'can' => \Illuminate\Auth\Middleware\Authorize::class,
6264
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
6365
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
64-
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
66+
'signed' => \App\Http\Middleware\ValidateSignature::class,
6567
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequestsWithRedis::class,
6668
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
6769
'ipcheck' => \App\Http\Middleware\IpCheck::class,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
6+
7+
class ValidateSignature extends Middleware
8+
{
9+
/**
10+
* The names of the query string parameters that should be ignored.
11+
*
12+
* @var array<int, string>
13+
*/
14+
protected $except = [
15+
// 'fbclid',
16+
// 'utm_campaign',
17+
// 'utm_content',
18+
// 'utm_medium',
19+
// 'utm_source',
20+
// 'utm_term',
21+
];
22+
}

app/Listeners/LogSentMessage.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use HMS\Repositories\UserRepository;
99
use Illuminate\Contracts\Queue\ShouldQueue;
1010
use Illuminate\Mail\Events\MessageSending;
11+
use Illuminate\Mail\Events\MessageSent;
1112

1213
class LogSentMessage implements ShouldQueue
1314
{
@@ -48,18 +49,25 @@ public function __construct(
4849
/**
4950
* Handle the event.
5051
*
51-
* @param IlluminateMailEventsMessageSending $event
52+
* @param MessageSending $event
5253
*
5354
* @return void
5455
*/
55-
public function handle(MessageSending $event)
56+
public function handle(MessageSent $event)
5657
{
57-
// grab the various bits of info from the Swift_Message
58-
$messageId = $event->message->getHeaders()->get('message-id')->getId();
59-
$toAddresses = $event->message->getHeaders()->get('to')->getNameAddresses();
60-
$subject = $event->message->getHeaders()->get('subject')->getValue();
61-
$body = $event->message->getBody();
62-
$fullString = $event->message->toString();
58+
// grab the various bits of info from the Symfony Sent Message
59+
$messageId = $event->sent->getMessageId();
60+
$toAddresses = collect($event->sent->getOriginalMessage()->getTo())
61+
->mapWithKeys(fn ($a, $k) => [$a->getAddress() => $a->getName() ?: null])
62+
->toArray();
63+
$subject = $event->sent->getOriginalMessage()->getSubject();
64+
$body = collect(
65+
$event->sent->getOriginalMessage()->getBody()->getParts()
66+
)
67+
->filter(fn ($tp) => $tp->getMediaSubtype() == 'html')
68+
->first()
69+
->getBody();
70+
$fullString = $event->sent->getOriginalMessage()->toString();
6371

6472
$email = new Email($toAddresses, $subject, $body, $fullString, $messageId);
6573

app/Providers/AuthServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class AuthServiceProvider extends ServiceProvider
1616
{
1717
/**
18-
* The policy mappings for the application.
18+
* The model to policy mappings for the application.
1919
*
2020
* @var array<class-string, class-string>
2121
*/
@@ -37,7 +37,6 @@ public function boot(EntityManagerInterface $em, PasswordStore $passwordStore)
3737
});
3838

3939
// Passport bits.
40-
Passport::routes();
4140
Passport::cookie(Str::slug(config('app.name'), '_') . '_passport');
4241
Passport::tokensExpireIn(
4342
now()->addDays(config('hms.passport_token_expire_days', 15))

app/Providers/EventServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class EventServiceProvider extends ServiceProvider
1616
{
1717
/**
18-
* The event listener mappings for the application.
18+
* The event to listener mappings for the application.
1919
*
2020
* @var array<class-string, array<int, class-string>>
2121
*/

app/Providers/HorizonServiceProvider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,22 @@ public function register()
2323

2424
/**
2525
* Bootstrap any application services.
26-
*
27-
* @return void
2826
*/
29-
public function boot()
27+
public function boot(): void
3028
{
3129
parent::boot();
3230

3331
// Horizon::routeSmsNotificationsTo('15556667777');
3432
// Horizon::routeMailNotificationsTo('example@example.com');
3533
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
36-
37-
Horizon::night();
3834
}
3935

4036
/**
4137
* Register the Horizon gate.
4238
*
4339
* This gate determines who can access Horizon in non-local environments.
44-
*
45-
* @return void
4640
*/
47-
protected function gate()
41+
protected function gate(): void
4842
{
4943
Gate::define('viewHorizon', function ($user) {
5044
return $user->can('horizon.view');

0 commit comments

Comments
 (0)