Skip to content

Commit

Permalink
adding logic for checkbox privacy policy
Browse files Browse the repository at this point in the history
  • Loading branch information
butburg committed Aug 4, 2024
1 parent 24aeaa3 commit 43365db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function store(Request $request): RedirectResponse
'name' => ['required', 'string', 'max:255', 'unique:' . User::class],
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:' . User::class],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
'privacy_policy' => 'accepted',
]);

$user = User::create([
Expand Down
9 changes: 5 additions & 4 deletions src/resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@
<div class="mt-4 flex items-center">
<input
class="h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500"
id="link-checkbox" type="checkbox" value="">
<label class="ms-2 text-sm font-medium text-gray-900" for="link-checkbox">I agree
with the <a class="text-c-accent hover:underline" href="{{route('impressum')}}">privacy policy</a>.</label>
id="privacy_policy" name="privacy_policy" type="checkbox" value="1">
<label class="ms-2 text-sm font-medium text-gray-900" for="privacy_policy">I agree
with the <a class="text-c-accent hover:underline" href="{{ route('impressum') }}">privacy
policy</a>.</label>
</div>

<x-input-error class="mt-2" :messages="$errors->get('privacy_policy')" />
<div class="mt-4 flex items-center justify-end">

<x-primary-button class="ms-4">
Expand Down

0 comments on commit 43365db

Please sign in to comment.