Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/Livewire/Traits/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ trait Alert
public function success(string $title = 'Done!', string $description = 'Task completed successfully.'): void
{
$this->dialog()
->success($title, $description)
->success(__($title), __($description))
->send();
}

public function error(string $title = 'Ooops!', string $description = 'Something went wrong!'): void
{
$this->dialog()
->error($title, $description)
->error(__($title), __($description))
->send();
}

public function warning(string $title = 'Ooops!', string $description = null): void
{
$this->dialog()
->warning($title, $description)
->warning(__($title), __($description))
->send();
}

public function info(string $title = 'Warning!', string $description = null): void
{
$this->dialog()
->info($title, $description)
->info(__($title), __($description))
->send();
}

public function question(string $title = 'Warning!', string $description = 'Are you sure?'): Dialog
{
return $this->dialog()->question($title, $description);
return $this->dialog()->question(__($title), __($description));
}
}
4 changes: 2 additions & 2 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
</x-slot:action>
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-dropdown.items text="Profile" :href="route('user.profile')" />
<x-dropdown.items text="Logout" onclick="event.preventDefault(); this.closest('form').submit();" separator />
<x-dropdown.items :text="__('Profile')" :href="route('user.profile')" />
<x-dropdown.items :text="__('Logout')" onclick="event.preventDefault(); this.closest('form').submit();" separator />
</form>
</x-dropdown>
</x-slot:right>
Expand Down
16 changes: 8 additions & 8 deletions resources/views/livewire/user/profile.blade.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<div @updated="$dispatch('name-updated', { name: $event.detail.name })">
<x-card>
<x-slot:header>
Edit Your Profile
@lang('Edit Your Profile')
</x-slot:header>
<form id="update-profile" wire:submit="save">
<div class="space-y-6">
<div>
<x-input label="Name *" wire:model="user.name" required />
<x-input label="{{ __('Name') }} *" wire:model="user.name" required />
</div>
<div>
<x-input label="Email *" value="{{ $user->email }}" disabled />
<x-input label="{{ __('Email') }} *" value="{{ $user->email }}" disabled />
</div>
<div>
<x-password label="Password"
hint="The password will only be updated if you set the value of this field"
<x-password :label="__('Password')"
:hint="__('The password will only be updated if you set the value of this field')"
wire:model="password"
rules
generator
x-on:generate="$wire.set('password_confirmation', $event.detail.password)" />
</div>
<div>
<x-password label="Password" wire:model="password_confirmation" rules />
<x-password :label="__('Confirm password')" wire:model="password_confirmation" rules />
</div>
</div>
<x-slot:footer>
<x-button type="submit">
Save
@lang('Save')
</x-button>
</x-slot:footer>
</form>
<x-slot:footer>
<x-button type="submit" form="update-profile">
Save
@lang('Save')
</x-button>
</x-slot:footer>
</x-card>
Expand Down
12 changes: 6 additions & 6 deletions resources/views/livewire/users/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div>
<x-button text="Create New User" wire:click="$toggle('modal')" sm />
<x-button :text="__('Create New User')" wire:click="$toggle('modal')" sm />

<x-modal :title="__('Create New User')" wire x-on:open="setTimeout(() => $refs.name.focus(), 250)">
<form id="user-create" wire:submit="save" class="space-y-4">
<div>
<x-input label="Name *" x-ref="name" wire:model="user.name" required />
<x-input label="{{ __('Name') }} *" x-ref="name" wire:model="user.name" required />
</div>

<div>
<x-input label="Email *" wire:model="user.email" required />
<x-input label="{{ __('Email') }} *" wire:model="user.email" required />
</div>

<div>
<x-password label="Password *"
<x-password label="{{ __('Password') }} *"
wire:model="password"
rules
generator
Expand All @@ -21,12 +21,12 @@
</div>

<div>
<x-password label="Password" wire:model="password_confirmation" rules required />
<x-password :label="__('Password')" wire:model="password_confirmation" rules required />
</div>
</form>
<x-slot:footer>
<x-button type="submit" form="user-create">
Save
@lang('Save')
</x-button>
</x-slot:footer>
</x-modal>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/livewire/users/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<div>
<x-alert color="amber" icon="light-bulb">
Remember to take a look at the source code to understand how the components in this area were built and are being used.
@lang('Remember to take a look at the source code to understand how the components in this area were built and are being used.')
</x-alert>

<div class="mb-2 mt-4">
<livewire:users.create @created="$refresh" />
</div>

<x-table :$headers :$sort :rows="$this->rows" paginate simple-pagination filter>
<x-table :$headers :$sort :rows="$this->rows" paginate simple-pagination filter :quantity="[2, 5, 15, 25]">
@interact('column_created_at', $row)
{{ $row->created_at->diffForHumans() }}
@endinteract

@interact('column_action', $row)
<div class="flex gap-1">
<x-button.circle icon="pencil" wire:click="$dispatch('load::user', { 'user' : '{{ $row->id }}'})" />
<livewire:users.delete :user="$row" :key="uniqid()" @deleted="$refresh" />
<livewire:users.delete :user="$row" :key="uniqid('', true)" @deleted="$refresh" />
</div>
@endinteract
</x-table>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/livewire/users/update.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<x-modal :title="__('Update User: #:id', ['id' => $user?->id])" wire>
<form id="user-update-{{ $user?->id }}" wire:submit="save" class="space-y-4">
<div>
<x-input label="Name *" wire:model="user.name" required />
<x-input label="{{ __('Name') }} *" wire:model="user.name" required />
</div>

<div>
<x-input label="Email *" wire:model="user.email" required />
<x-input label="{{ __('Email') }} *" wire:model="user.email" required />
</div>

<div>
<x-password label="Password"
<x-password :label="__('Password')"
hint="The password will only be updated if you set the value of this field"
wire:model="password"
rules
Expand All @@ -19,12 +19,12 @@
</div>

<div>
<x-password label="Password" wire:model="password_confirmation" rules />
<x-password :label="__('Password')" wire:model="password_confirmation" rules />
</div>
</form>
<x-slot:footer>
<x-button type="submit" form="user-update-{{ $user?->id }}">
Save
@lang('Save')
</x-button>
</x-slot:footer>
</x-modal>
Expand Down