From 1914bc509426dc91dfa3f1e19f1a2360fb9ea402 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:45:17 +0100 Subject: [PATCH 01/14] wip --- app/Actions/Fortify/CreateNewUser.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index ea476c2..98277ca 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -19,17 +19,17 @@ class CreateNewUser implements CreatesNewUsers * * @param array $input */ - public function create(array $input): User - { - // This is a random comment! + public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => $this->passwordRules(), - 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', - ])->validate(); + 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : ''])->validate(); + + return + - return DB::transaction(function () use ($input) { + DB::transaction(function () use ($input) { return tap(User::create([ 'name' => $input['name'], 'email' => $input['email'], From b68da97b893b97ed3df5964f2d307a162b635e9d Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:48:54 +0100 Subject: [PATCH 02/14] wip --- .github/workflows/laravel-pint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index fa0437b..fd7bd95 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -24,4 +24,8 @@ jobs: run: pint --test - name: Push Back to Repo - run: echo "TODO" + run: | + git config user.name "gh-actions" + git config user.email "gh-actions@laracasts.com" + git commit -m "Laravel Pint" + git push From a85dcf1917db17372203151db84efbf8cf1057ac Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:49:30 +0100 Subject: [PATCH 03/14] wip --- .github/workflows/laravel-pint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index fd7bd95..5c2a42a 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -21,7 +21,7 @@ jobs: run: composer global require laravel/pint - name: Run Laravel Pint - run: pint --test + run: pint - name: Push Back to Repo run: | From 03e084d79c71e8ef32a2b722b1780fb1252e211e Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:51:07 +0100 Subject: [PATCH 04/14] wip --- .github/workflows/laravel-pint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index 5c2a42a..8a66d3a 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -27,5 +27,6 @@ jobs: run: | git config user.name "gh-actions" git config user.email "gh-actions@laracasts.com" + git add . git commit -m "Laravel Pint" git push From 77e4c87e2a2066457274ac614879f6af70fbbcd3 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:53:23 +0100 Subject: [PATCH 05/14] wip --- .github/workflows/laravel-pint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index 8a66d3a..02c46d0 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v4.1.7 + with: + ref: ${{ github.head_ref }} - name: Setup PHP and Composer uses: shivammathur/setup-php@2.31.1 From 73f34f66e5a4d8f5f83231a4cd76d76cc8f6bc09 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Mon, 12 Aug 2024 09:53:46 +0000 Subject: [PATCH 06/14] Laravel Pint --- app/Actions/Fortify/CreateNewUser.php | 22 +++++++++++----------- app/Actions/Jetstream/DeleteUser.php | 4 +--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 98277ca..007e557 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -17,9 +17,10 @@ class CreateNewUser implements CreatesNewUsers /** * Create a newly registered user. * - * @param array $input + * @param array $input */ - public function create(array $input): User { + public function create(array $input): User + { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], @@ -28,16 +29,15 @@ public function create(array $input): User { return - DB::transaction(function () use ($input) { - return tap(User::create([ - 'name' => $input['name'], - 'email' => $input['email'], - 'password' => Hash::make($input['password']), - ]), function (User $user) { - $this->createTeam($user); + return tap(User::create([ + 'name' => $input['name'], + 'email' => $input['email'], + 'password' => Hash::make($input['password']), + ]), function (User $user) { + $this->createTeam($user); + }); }); - }); } /** @@ -47,7 +47,7 @@ protected function createTeam(User $user): void { $user->ownedTeams()->save(Team::forceCreate([ 'user_id' => $user->id, - 'name' => explode(' ', $user->name, 2)[0] . "'s Team", + 'name' => explode(' ', $user->name, 2)[0]."'s Team", 'personal_team' => true, ])); } diff --git a/app/Actions/Jetstream/DeleteUser.php b/app/Actions/Jetstream/DeleteUser.php index 4b051af..807bf01 100644 --- a/app/Actions/Jetstream/DeleteUser.php +++ b/app/Actions/Jetstream/DeleteUser.php @@ -13,9 +13,7 @@ class DeleteUser implements DeletesUsers /** * Create a new action instance. */ - public function __construct(protected DeletesTeams $deletesTeams) - { - } + public function __construct(protected DeletesTeams $deletesTeams) {} /** * Delete the given user. From 056b33913853daa02a6ed7345ba006a82eb40a93 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:54:53 +0100 Subject: [PATCH 07/14] wip --- app/Actions/Fortify/CreateNewUser.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 007e557..046a944 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -17,7 +17,7 @@ class CreateNewUser implements CreatesNewUsers /** * Create a newly registered user. * - * @param array $input + * @param array $input */ public function create(array $input): User { @@ -27,17 +27,15 @@ public function create(array $input): User 'password' => $this->passwordRules(), 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : ''])->validate(); - return - - DB::transaction(function () use ($input) { - return tap(User::create([ - 'name' => $input['name'], - 'email' => $input['email'], - 'password' => Hash::make($input['password']), - ]), function (User $user) { - $this->createTeam($user); - }); + return DB::transaction(function () use ($input) { + return tap(User::create([ + 'name' => $input['name'], + 'email' => $input['email'], + 'password' => Hash::make($input['password']), + ]), function (User $user) { + $this->createTeam($user); }); + }); } /** @@ -47,7 +45,7 @@ protected function createTeam(User $user): void { $user->ownedTeams()->save(Team::forceCreate([ 'user_id' => $user->id, - 'name' => explode(' ', $user->name, 2)[0]."'s Team", + 'name' => explode(' ', $user->name, 2)[0] . "'s Team", 'personal_team' => true, ])); } From 29bbb5c32e73a593cae2b233aa5c00f7b734ea83 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Mon, 12 Aug 2024 09:55:17 +0000 Subject: [PATCH 08/14] Laravel Pint --- app/Actions/Fortify/CreateNewUser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 046a944..b82c7bc 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -17,7 +17,7 @@ class CreateNewUser implements CreatesNewUsers /** * Create a newly registered user. * - * @param array $input + * @param array $input */ public function create(array $input): User { @@ -45,7 +45,7 @@ protected function createTeam(User $user): void { $user->ownedTeams()->save(Team::forceCreate([ 'user_id' => $user->id, - 'name' => explode(' ', $user->name, 2)[0] . "'s Team", + 'name' => explode(' ', $user->name, 2)[0]."'s Team", 'personal_team' => true, ])); } From 36397109144f905443b4ff16a52b1a348ccdc147 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:55:40 +0100 Subject: [PATCH 09/14] wip --- app/Actions/Fortify/CreateNewUser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index b82c7bc..8670ead 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -25,7 +25,8 @@ public function create(array $input): User 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => $this->passwordRules(), - 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : ''])->validate(); + 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '' + ])->validate(); return DB::transaction(function () use ($input) { return tap(User::create([ From 7263f25d5ab25f4a76067d8317470faf8f4b1c37 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Mon, 12 Aug 2024 09:56:10 +0000 Subject: [PATCH 10/14] Laravel Pint --- app/Actions/Fortify/CreateNewUser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 8670ead..bb4bbe2 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -25,7 +25,7 @@ public function create(array $input): User 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => $this->passwordRules(), - 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '' + 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', ])->validate(); return DB::transaction(function () use ($input) { From 6b5739d1e3469d39827f7b004001136031d42a4b Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:56:44 +0100 Subject: [PATCH 11/14] wip --- app/Actions/Fortify/CreateNewUser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index bb4bbe2..7bcc824 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -22,7 +22,7 @@ class CreateNewUser implements CreatesNewUsers public function create(array $input): User { Validator::make($input, [ - 'name' => ['required', 'string', 'max:255'], + 'name' => ['required', 'string', 'max:255', 'nullable'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => $this->passwordRules(), 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', From d9d3070731917eadfd4604c768c0a4e151ab25a0 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 10:58:20 +0100 Subject: [PATCH 12/14] wip --- .github/workflows/laravel-pint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index 02c46d0..fe6212a 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -30,5 +30,5 @@ jobs: git config user.name "gh-actions" git config user.email "gh-actions@laracasts.com" git add . - git commit -m "Laravel Pint" + git commit -m "Laravel Pint" || exit 0 git push From 30b0c69e1ba1b3ae8526b408e693512cb1ce8aa6 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 11:02:21 +0100 Subject: [PATCH 13/14] wip --- .github/workflows/laravel-pint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/laravel-pint.yml b/.github/workflows/laravel-pint.yml index fe6212a..0679a23 100644 --- a/.github/workflows/laravel-pint.yml +++ b/.github/workflows/laravel-pint.yml @@ -1,7 +1,9 @@ name: Laravel Pint on: - pull_request + push: + branches: + - main jobs: laravel-pint: From 0d35bab392a24768391b52859a7028a6513e5a57 Mon Sep 17 00:00:00 2001 From: lukeraymonddowning Date: Mon, 12 Aug 2024 11:02:48 +0100 Subject: [PATCH 14/14] wip --- app/Actions/Fortify/CreateNewUser.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 7bcc824..8cbcc92 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -19,8 +19,7 @@ class CreateNewUser implements CreatesNewUsers * * @param array $input */ - public function create(array $input): User - { + public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255', 'nullable'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],