Skip to content

Commit 3c98d5e

Browse files
committed
Merge remote-tracking branch 'origin/Laravel-8'
2 parents 0fbb031 + 1802f9f commit 3c98d5e

77 files changed

Lines changed: 14487 additions & 3649 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DOCTRINE_LOGGER=LaravelDoctrine\ORM\Loggers\LaravelDebugbarLogger
2020
PASSPORT_TOKEN_EXPIRE_DAYS=15
2121
PASSPORT_REFRESH_TOKEN_EXPIRE_DAYS=30
2222

23-
BROADCAST_DRIVER=redis
23+
BROADCAST_DRIVER=pusher
2424
CACHE_DRIVER=redis
2525
QUEUE_CONNECTION=sync
2626
SESSION_DRIVER=redis
@@ -34,7 +34,7 @@ LARAVEL_ECHO_SERVER_AUTH_HOST="${APP_URL}"
3434
LARAVEL_ECHO_SERVER_REDIS_HOST="${REDIS_HOST}"
3535
LARAVEL_ECHO_SERVER_REDIS_PASSWORD="${REDIS_PASSWORD}"
3636

37-
MAIL_DRIVER=smtp
37+
MAIL_MAILER=smtp
3838
MAIL_HOST=hmsdev
3939
MAIL_PORT=1025
4040
MAIL_USERNAME=
@@ -54,12 +54,18 @@ AWS_SECRET_ACCESS_KEY=
5454
AWS_DEFAULT_REGION=us-east-1
5555
AWS_BUCKET=
5656

57-
PUSHER_APP_ID=
58-
PUSHER_APP_KEY=
59-
PUSHER_APP_SECRET=
57+
PUSHER_APP_ID=hms
58+
PUSHER_APP_KEY=hms
59+
PUSHER_APP_SECRET=hms
60+
PUSHER_HOST=hmsdev
61+
PUSHER_PORT=6001
62+
PUSHER_SCHEME=https
6063
PUSHER_APP_CLUSTER=mt1
6164

6265
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
66+
MIX_PUSHER_HOST="${PUSHER_HOST}"
67+
MIX_PUSHER_PORT="${PUSHER_PORT}"
68+
MIX_PUSHER_SCHEME="${PUSHER_SCHEME}"
6369
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
6470

6571
PASSWORDSTORE=kerberos

Vagrantfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
1111

1212
# Every Vagrant virtual environment requires a box to build off of.
1313
config.vm.box = "NottingHack/hms2"
14-
config.vm.box_version = ">=1.5.0"
14+
config.vm.box_version = ">=1.6.0"
1515
config.vm.hostname = "hmsdev.nottingtest.org.uk"
1616

1717
config.vm.provider :virtualbox do |vb|
@@ -26,14 +26,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
2626
config.vm.provision :shell, path: "dev/vagrant-config/scripts/mix.sh", privileged: false
2727
config.vm.provision :shell, path: "dev/vagrant-config/scripts/labelprinter.sh"
2828
config.vm.provision :shell, path: "dev/vagrant-config/scripts/laravel-queue.sh"
29-
config.vm.provision :shell, path: "dev/vagrant-config/scripts/echo.sh"
3029
config.vm.provision :shell, path: "dev/vagrant-config/scripts/finish.sh"
3130

3231
config.vm.network "private_network", ip: "192.168.25.35"
3332

3433
config.trigger.after :up, :resume, :reload do |trigger|
3534
trigger.info = "Restaring Nginx & PHP"
36-
trigger.run_remote = {inline: "sudo systemctl restart nginx php7.2-fpm php7.4-fpm laravel-echo-server horizon"}
35+
trigger.run_remote = {inline: "sudo systemctl restart nginx php* soketi horizon"}
3736
end
3837

3938
end

app/Console/Kernel.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@
1818

1919
class Kernel extends ConsoleKernel
2020
{
21-
/**
22-
* The Artisan commands provided by your application.
23-
*
24-
* @var array
25-
*/
26-
protected $commands = [
27-
//
28-
];
29-
3021
/**
3122
* Define the application's command schedule.
3223
*

app/Exceptions/Handler.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
namespace App\Exceptions;
44

55
use Doctrine\ORM\EntityNotFoundException;
6-
use Exception;
76
use Illuminate\Auth\Access\AuthorizationException;
87
use Illuminate\Auth\AuthenticationException;
98
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
109
use Illuminate\Http\Response as IlluminateResponse;
1110
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
11+
use Throwable;
1212

1313
class Handler extends ExceptionHandler
1414
{
1515
/**
1616
* A list of the exception types that are not reported.
1717
*
18-
* @var array
18+
* @var array<int, class-string<Throwable>>
1919
*/
2020
protected $dontReport = [
2121
//
@@ -24,37 +24,26 @@ class Handler extends ExceptionHandler
2424
/**
2525
* A list of the inputs that are never flashed for validation exceptions.
2626
*
27-
* @var array
27+
* @var array<int, string>
2828
*/
2929
protected $dontFlash = [
30+
'current_password',
3031
'password',
3132
'password_confirmation',
3233
'currentPassword',
3334
];
3435

35-
/**
36-
* Report or log an exception.
37-
*
38-
* @param \Exception $exception
39-
*
40-
* @return void
41-
*/
42-
public function report(Exception $exception)
43-
{
44-
parent::report($exception);
45-
}
46-
4736
/**
4837
* Render an exception into an HTTP response.
4938
*
5039
* @param \Illuminate\Http\Request $request
51-
* @param \Exception $exception
40+
* @param \Throwable $exception
5241
*
5342
* @return \Illuminate\Http\Response
5443
*
5544
* @throws \Illuminate\Auth\Access\AuthorizationException
5645
*/
57-
public function render($request, Exception $exception)
46+
public function render($request, Throwable $exception)
5847
{
5948
if ($exception instanceof AuthorizationException) {
6049
return $this->unauthorized($request, $exception);

app/Http/Kernel.php

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ class Kernel extends HttpKernel
1111
*
1212
* These middleware are run during every request to your application.
1313
*
14-
* @var array
14+
* @var array<int, class-string|string>
1515
*/
1616
protected $middleware = [
17+
// \App\Http\Middleware\TrustHosts::class,
1718
\App\Http\Middleware\TrustProxies::class,
18-
\App\Http\Middleware\CheckForMaintenanceMode::class,
19+
\Fruitcake\Cors\HandleCors::class,
20+
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
1921
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2022
\App\Http\Middleware\TrimStrings::class,
2123
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
@@ -24,7 +26,7 @@ class Kernel extends HttpKernel
2426
/**
2527
* The application's route middleware groups.
2628
*
27-
* @var array
29+
* @var array<string, array<int, class-string|string>>
2830
*/
2931
protected $middlewareGroups = [
3032
'web' => [
@@ -39,7 +41,7 @@ class Kernel extends HttpKernel
3941
],
4042

4143
'api' => [
42-
'throttle:60,1',
44+
'throttle:api',
4345
\Illuminate\Routing\Middleware\SubstituteBindings::class,
4446
\LaravelDoctrine\ORM\Middleware\SubstituteBindings::class,
4547
],
@@ -50,12 +52,11 @@ class Kernel extends HttpKernel
5052
*
5153
* These middleware may be assigned to groups or used individually.
5254
*
53-
* @var array
55+
* @var array<string, class-string|string>
5456
*/
5557
protected $routeMiddleware = [
5658
'auth' => \App\Http\Middleware\Authenticate::class,
5759
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58-
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
5960
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
6061
'can' => \Illuminate\Auth\Middleware\Authorize::class,
6162
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
@@ -70,21 +71,4 @@ class Kernel extends HttpKernel
7071
'canAll' => \App\Http\Middleware\AuthorizeAll::class,
7172
'feature' => \App\Http\Middleware\CheckEnabledFeatures::class,
7273
];
73-
74-
/**
75-
* The priority-sorted list of middleware.
76-
*
77-
* This forces the listed middleware to always be in the given order.
78-
*
79-
* @var array
80-
*/
81-
protected $middlewarePriority = [
82-
\Illuminate\Session\Middleware\StartSession::class,
83-
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
84-
\App\Http\Middleware\Authenticate::class,
85-
\Illuminate\Routing\Middleware\ThrottleRequests::class,
86-
\Illuminate\Session\Middleware\AuthenticateSession::class,
87-
\Illuminate\Routing\Middleware\SubstituteBindings::class,
88-
\Illuminate\Auth\Middleware\Authorize::class,
89-
];
9074
}

app/Http/Middleware/Authenticate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Authenticate extends Middleware
1515
*/
1616
protected function redirectTo($request)
1717
{
18-
return route('login');
18+
if (! $request->expectsJson()) {
19+
return route('login');
20+
}
1921
}
2022
}

app/Http/Middleware/EncryptCookies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class EncryptCookies extends Middleware
99
/**
1010
* The names of the cookies that should not be encrypted.
1111
*
12-
* @var array
12+
* @var array<int, string>
1313
*/
1414
protected $except = [
1515
//
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
6+
7+
class PreventRequestsDuringMaintenance extends Middleware
8+
{
9+
/**
10+
* The URIs that should be reachable while maintenance mode is enabled.
11+
*
12+
* @var array<int, string>
13+
*/
14+
protected $except = [
15+
//
16+
];
17+
}

app/Http/Middleware/RedirectIfAuthenticated.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,28 @@
44

55
use App\Providers\RouteServiceProvider;
66
use Closure;
7+
use Illuminate\Http\Request;
78
use Illuminate\Support\Facades\Auth;
89

910
class RedirectIfAuthenticated
1011
{
1112
/**
1213
* Handle an incoming request.
1314
*
14-
* @param \Illuminate\Http\Request $request
15-
* @param \Closure $next
16-
* @param string|null $guard
15+
* @param \Illuminate\Http\Request $request
16+
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
17+
* @param string|null ...$guards
1718
*
18-
* @return mixed
19+
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
1920
*/
20-
public function handle($request, Closure $next, $guard = null)
21+
public function handle(Request $request, Closure $next, ...$guards)
2122
{
22-
if (Auth::guard($guard)->check()) {
23-
return redirect(RouteServiceProvider::HOME);
23+
$guards = empty($guards) ? [null] : $guards;
24+
25+
foreach ($guards as $guard) {
26+
if (Auth::guard($guard)->check()) {
27+
return redirect(RouteServiceProvider::HOME);
28+
}
2429
}
2530

2631
return $next($request);

app/Http/Middleware/TrimStrings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ class TrimStrings extends Middleware
99
/**
1010
* The names of the attributes that should not be trimmed.
1111
*
12-
* @var array
12+
* @var array<int, string>
1313
*/
1414
protected $except = [
15+
'current_password',
1516
'password',
1617
'password_confirmation',
1718
'currentPassword',

0 commit comments

Comments
 (0)