Skip to content

Commit 157c7aa

Browse files
3.0.0 - Upgrade to Laravel 10, Jetstream 4 and Livewire 3
1 parent 995efb3 commit 157c7aa

File tree

143 files changed

+3995
-3593
lines changed

Some content is hidden

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

143 files changed

+3995
-3593
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ root = true
33
[*]
44
charset = utf-8
55
end_of_line = lf
6-
insert_final_newline = true
7-
indent_style = space
86
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

1111
[*.md]

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ REDIS_PASSWORD=null
2929
REDIS_PORT=6379
3030

3131
MAIL_MAILER=smtp
32-
MAIL_HOST=mailhog
32+
MAIL_HOST=mailpit
3333
MAIL_PORT=1025
3434
MAIL_USERNAME=null
3535
MAIL_PASSWORD=null
@@ -51,6 +51,7 @@ PUSHER_PORT=443
5151
PUSHER_SCHEME=https
5252
PUSHER_APP_CLUSTER=mt1
5353

54+
VITE_APP_NAME="${APP_NAME}"
5455
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
5556
VITE_PUSHER_HOST="${PUSHER_HOST}"
5657
VITE_PUSHER_PORT="${PUSHER_PORT}"

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* text=auto
1+
* text=auto eol=lf
22

33
*.blade.php diff=html
44
*.css diff=css
@@ -8,3 +8,4 @@
88

99
/.github export-ignore
1010
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.phpunit.cache
12
/node_modules
23
/public/build
34
/public/hot
@@ -6,10 +7,13 @@
67
/vendor
78
.env
89
.env.backup
10+
.env.production
911
.phpunit.result.cache
1012
Homestead.json
1113
Homestead.yaml
14+
auth.json
1215
npm-debug.log
1316
yarn-error.log
17+
/.fleet
1418
/.idea
1519
/.vscode

.styleci.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG.md
22

3+
## [3.0.0] - 2024-01-05
4+
5+
- Upgrade to Laravel 10, Jetstream 4 and Livewire 3
6+
37
## [2.1.0] - 2023-06-23
48

59
- Account settings page fixes

app/Actions/Fortify/CreateNewUser.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ class CreateNewUser implements CreatesNewUsers
1515
/**
1616
* Validate and create a newly registered user.
1717
*
18-
* @param array $input
19-
* @return \App\Models\User
18+
* @param array<string, string> $input
2019
*/
21-
public function create(array $input)
20+
public function create(array $input): User
2221
{
2322
Validator::make($input, [
2423
'name' => ['required', 'string', 'max:255'],

app/Actions/Fortify/PasswordValidationRules.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
namespace App\Actions\Fortify;
44

5-
use Laravel\Fortify\Rules\Password;
5+
use Illuminate\Validation\Rules\Password;
66

77
trait PasswordValidationRules
88
{
99
/**
1010
* Get the validation rules used to validate passwords.
1111
*
12-
* @return array
12+
* @return array<int, \Illuminate\Contracts\Validation\Rule|array|string>
1313
*/
14-
protected function passwordRules()
14+
protected function passwordRules(): array
1515
{
16-
return ['required', 'string', new Password, 'confirmed'];
16+
return ['required', 'string', Password::default(), 'confirmed'];
1717
}
1818
}

app/Actions/Fortify/ResetUserPassword.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Actions\Fortify;
44

5+
use App\Models\User;
56
use Illuminate\Support\Facades\Hash;
67
use Illuminate\Support\Facades\Validator;
78
use Laravel\Fortify\Contracts\ResetsUserPasswords;
@@ -13,11 +14,9 @@ class ResetUserPassword implements ResetsUserPasswords
1314
/**
1415
* Validate and reset the user's forgotten password.
1516
*
16-
* @param mixed $user
17-
* @param array $input
18-
* @return void
17+
* @param array<string, string> $input
1918
*/
20-
public function reset($user, array $input)
19+
public function reset(User $user, array $input): void
2120
{
2221
Validator::make($input, [
2322
'password' => $this->passwordRules(),

app/Actions/Fortify/UpdateUserPassword.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Actions\Fortify;
44

5+
use App\Models\User;
56
use Illuminate\Support\Facades\Hash;
67
use Illuminate\Support\Facades\Validator;
78
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
@@ -13,20 +14,16 @@ class UpdateUserPassword implements UpdatesUserPasswords
1314
/**
1415
* Validate and update the user's password.
1516
*
16-
* @param mixed $user
17-
* @param array $input
18-
* @return void
17+
* @param array<string, string> $input
1918
*/
20-
public function update($user, array $input)
19+
public function update(User $user, array $input): void
2120
{
2221
Validator::make($input, [
23-
'current_password' => ['required', 'string'],
22+
'current_password' => ['required', 'string', 'current_password:web'],
2423
'password' => $this->passwordRules(),
25-
])->after(function ($validator) use ($user, $input) {
26-
if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) {
27-
$validator->errors()->add('current_password', __('The provided password does not match your current password.'));
28-
}
29-
})->validateWithBag('updatePassword');
24+
], [
25+
'current_password.current_password' => __('The provided password does not match your current password.'),
26+
])->validateWithBag('updatePassword');
3027

3128
$user->forceFill([
3229
'password' => Hash::make($input['password']),

app/Actions/Fortify/UpdateUserProfileInformation.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Actions\Fortify;
44

5+
use App\Models\User;
56
use Illuminate\Contracts\Auth\MustVerifyEmail;
67
use Illuminate\Support\Facades\Validator;
78
use Illuminate\Validation\Rule;
@@ -12,11 +13,9 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
1213
/**
1314
* Validate and update the given user's profile information.
1415
*
15-
* @param mixed $user
16-
* @param array $input
17-
* @return void
16+
* @param array<string, mixed> $input
1817
*/
19-
public function update($user, array $input)
18+
public function update(User $user, array $input): void
2019
{
2120
Validator::make($input, [
2221
'name' => ['required', 'string', 'max:255'],
@@ -42,11 +41,9 @@ public function update($user, array $input)
4241
/**
4342
* Update the given verified user's profile information.
4443
*
45-
* @param mixed $user
46-
* @param array $input
47-
* @return void
44+
* @param array<string, string> $input
4845
*/
49-
protected function updateVerifiedUser($user, array $input)
46+
protected function updateVerifiedUser(User $user, array $input): void
5047
{
5148
$user->forceFill([
5249
'name' => $input['name'],

app/Actions/Jetstream/DeleteUser.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
namespace App\Actions\Jetstream;
44

5+
use App\Models\User;
56
use Laravel\Jetstream\Contracts\DeletesUsers;
67

78
class DeleteUser implements DeletesUsers
89
{
910
/**
1011
* Delete the given user.
11-
*
12-
* @param mixed $user
13-
* @return void
1412
*/
15-
public function delete($user)
13+
public function delete(User $user): void
1614
{
1715
$user->deleteProfilePhoto();
1816
$user->tokens->each->delete();

app/Console/Kernel.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ class Kernel extends ConsoleKernel
99
{
1010
/**
1111
* Define the application's command schedule.
12-
*
13-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
14-
* @return void
1512
*/
16-
protected function schedule(Schedule $schedule)
13+
protected function schedule(Schedule $schedule): void
1714
{
1815
// $schedule->command('inspire')->hourly();
1916
}
2017

2118
/**
2219
* Register the commands for the application.
23-
*
24-
* @return void
2520
*/
26-
protected function commands()
21+
protected function commands(): void
2722
{
2823
$this->load(__DIR__.'/Commands');
2924

app/Exceptions/Handler.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,7 @@
88
class Handler extends ExceptionHandler
99
{
1010
/**
11-
* A list of exception types with their corresponding custom log levels.
12-
*
13-
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
14-
*/
15-
protected $levels = [
16-
//
17-
];
18-
19-
/**
20-
* A list of the exception types that are not reported.
21-
*
22-
* @var array<int, class-string<\Throwable>>
23-
*/
24-
protected $dontReport = [
25-
//
26-
];
27-
28-
/**
29-
* A list of the inputs that are never flashed to the session on validation exceptions.
11+
* The list of the inputs that are never flashed to the session on validation exceptions.
3012
*
3113
* @var array<int, string>
3214
*/
@@ -38,10 +20,8 @@ class Handler extends ExceptionHandler
3820

3921
/**
4022
* Register the exception handling callbacks for the application.
41-
*
42-
* @return void
4323
*/
44-
public function register()
24+
public function register(): void
4525
{
4626
$this->reportable(function (Throwable $e) {
4727
//

0 commit comments

Comments
 (0)