Skip to content

Commit

Permalink
Upgrade jetstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbilling committed Dec 9, 2023
1 parent 36cdbef commit 0fdc9d9
Show file tree
Hide file tree
Showing 27 changed files with 200 additions and 201 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"guzzlehttp/guzzle": "^7.2",
"kilobyteno/laravel-user-guest-like": "^1.1",
"laravel/framework": "^10.35",
"laravel/jetstream": "^2.15",
"laravel/jetstream": "^3.0",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"livewire/livewire": "^3.0",
Expand Down
27 changes: 13 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions resources/views/api/api-token-manager.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<!-- Generate API Token -->
<x-jet-form-section submit="createApiToken">
<x-form-section submit="createApiToken">
<x-slot name="title">
{{ __('Create API Token') }}
</x-slot>
Expand All @@ -12,20 +12,20 @@
<x-slot name="form">
<!-- Token Name -->
<div class="col-span-6 sm:col-span-4">
<x-jet-label for="name" value="{{ __('Token Name') }}" />
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
<x-jet-input-error for="name" class="mt-2" />
<x-label for="name" value="{{ __('Token Name') }}" />
<x-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
<x-input-error for="name" class="mt-2" />
</div>

<!-- Token Permissions -->
@if (Laravel\Jetstream\Jetstream::hasPermissions())
<div class="col-span-6">
<x-jet-label for="permissions" value="{{ __('Permissions') }}" />
<x-label for="permissions" value="{{ __('Permissions') }}" />

<div class="mt-2 grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-jet-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600 dark:text-gray-200">{{ $permission }}</span>
</label>
@endforeach
Expand All @@ -35,22 +35,22 @@
</x-slot>

<x-slot name="actions">
<x-jet-action-message class="mr-3" on="created">
<x-action-message class="mr-3" on="created">
{{ __('Created.') }}
</x-jet-action-message>

<x-jet-button>
<x-button>
{{ __('Create') }}
</x-jet-button>
</x-slot>
</x-jet-form-section>

@if ($this->user->tokens->isNotEmpty())
<x-jet-section-border />
<x-section-border />

<!-- Manage API Tokens -->
<div class="mt-10 sm:mt-0">
<x-jet-action-section>
<x-action-section>
<x-slot name="title">
{{ __('Manage API Tokens') }}
</x-slot>
Expand Down Expand Up @@ -94,7 +94,7 @@
@endif

<!-- Token Value Modal -->
<x-jet-dialog-modal wire:model.live="displayingToken">
<x-dialog-modal wire:model.live="displayingToken">
<x-slot name="title">
{{ __('API Token') }}
</x-slot>
Expand All @@ -104,22 +104,22 @@
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
</div>

<x-jet-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full"
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
/>
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
<x-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
{{ __('Close') }}
</x-jet-secondary-button>
</x-slot>
</x-jet-dialog-modal>

<!-- API Token Permissions Modal -->
<x-jet-dialog-modal wire:model.live="managingApiTokenPermissions">
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
<x-slot name="title">
{{ __('API Token Permissions') }}
</x-slot>
Expand All @@ -128,26 +128,26 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-jet-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600 dark:text-gray-200">{{ $permission }}</span>
</label>
@endforeach
</div>
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled">
<x-secondary-button wire:click="$set('managingApiTokenPermissions', false)" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>

<x-jet-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
<x-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
{{ __('Save') }}
</x-jet-button>
</x-slot>
</x-jet-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-jet-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-slot name="title">
{{ __('Delete API Token') }}
</x-slot>
Expand All @@ -157,11 +157,11 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
<x-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>

<x-jet-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
<x-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
{{ __('Delete') }}
</x-jet-danger-button>
</x-slot>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<img src="{{ asset('img/logo.png') }}" class="block h-9 w-auto" />
</x-slot>
Expand All @@ -8,18 +8,18 @@
{{ __('This is a secure area of the application. Please confirm your password before continuing.') }}
</div>

<x-jet-validation-errors class="mb-4" />
<x-validation-errors class="mb-4" />

<form method="POST" action="{{ route('password.confirm') }}">
@csrf

<div>
<x-jet-label for="password" value="{{ __('Password') }}" />
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" autofocus />
<x-label for="password" value="{{ __('Password') }}" />
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" autofocus />
</div>

<div class="flex justify-end mt-4">
<x-jet-button class="ml-4">
<x-button class="ml-4">
{{ __('Confirm') }}
</x-jet-button>
</div>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<img src="{{ asset('img/logo.png') }}" class="block w-auto" />
</x-slot>
Expand All @@ -14,18 +14,18 @@
</div>
@endif

<x-jet-validation-errors class="mb-4" />
<x-validation-errors class="mb-4" />

<form method="POST" action="{{ route('password.email') }}">
@csrf

<div class="block">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
<x-label for="email" value="{{ __('Email') }}" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
</div>

<div class="flex items-center justify-end mt-4">
<x-jet-button>
<x-button>
{{ __('Email Password Reset Link') }}
</x-jet-button>
</div>
Expand Down
16 changes: 8 additions & 8 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<img src="{{ asset('img/logo.png') }}" class="block w-auto" />
</x-slot>

<x-jet-validation-errors class="mb-4" />
<x-validation-errors class="mb-4" />

@if (session('status'))
<div class="mb-4 font-medium text-sm text-green-600">
Expand All @@ -16,18 +16,18 @@
@csrf

<div>
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
<x-label for="email" value="{{ __('Email') }}" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
</div>

<div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}" />
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" />
<x-label for="password" value="{{ __('Password') }}" />
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" />
</div>

<div class="block mt-4">
<label for="remember_me" class="flex items-center">
<x-jet-checkbox id="remember_me" name="remember" />
<x-checkbox id="remember_me" name="remember" />
<span class="ml-2 text-sm text-gray-600 dark:text-gray-200">{{ __('Remember me') }}</span>
</label>
</div>
Expand All @@ -39,7 +39,7 @@
</a>
@endif

<x-jet-button class="ml-4">
<x-button class="ml-4">
{{ __('Log in') }}
</x-jet-button>
</div>
Expand Down
26 changes: 13 additions & 13 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<img src="{{ asset('img/logo.png') }}" class="block w-auto" />
</x-slot>

<x-jet-validation-errors class="mb-4" />
<x-validation-errors class="mb-4" />

<form method="POST" action="{{ route('register') }}">
@csrf
@honeypot

<div>
<x-jet-label for="name" value="{{ __('Name') }}" />
<x-jet-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
<x-label for="name" value="{{ __('Name') }}" />
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
</div>

<div class="mt-4">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
<x-label for="email" value="{{ __('Email') }}" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
</div>

<div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}" />
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
<x-label for="password" value="{{ __('Password') }}" />
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
</div>

<div class="mt-4">
<x-jet-label for="password_confirmation" value="{{ __('Confirm Password') }}" />
<x-jet-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
<x-label for="password_confirmation" value="{{ __('Confirm Password') }}" />
<x-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
</div>

@if (Laravel\Jetstream\Jetstream::hasTermsAndPrivacyPolicyFeature())
<div class="mt-4">
<x-jet-label for="terms">
<x-label for="terms">
<div class="flex items-center">
<x-jet-checkbox name="terms" id="terms"/>
<x-checkbox name="terms" id="terms"/>

<div class="ml-2">
{!! __('I agree to the :terms_of_service and :privacy_policy', [
Expand All @@ -52,7 +52,7 @@
{{ __('Already registered?') }}
</a>

<x-jet-button class="ml-4">
<x-button class="ml-4">
{{ __('Register') }}
</x-jet-button>
</div>
Expand Down
Loading

0 comments on commit 0fdc9d9

Please sign in to comment.