43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
{{ __('Users') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
|
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
|
<div
|
|
class="p-6"
|
|
x-data="{
|
|
loading: false,
|
|
async paginate(url) {
|
|
this.loading = true;
|
|
const response = await fetch(url, {
|
|
headers: { 'X-Requested-With': 'XMLHttpRequest' }
|
|
});
|
|
this.$refs.tableContainer.innerHTML = await response.text();
|
|
this.loading = false;
|
|
}
|
|
}"
|
|
@click.prevent="
|
|
const link = $event.target.closest('a[href]');
|
|
if (link && $refs.tableContainer.contains(link)) {
|
|
paginate(link.href);
|
|
}
|
|
"
|
|
>
|
|
<div x-show="loading" class="text-center py-4 text-gray-500 dark:text-gray-400">
|
|
{{ __('Loading...') }}
|
|
</div>
|
|
|
|
<div x-ref="tableContainer" x-show="!loading">
|
|
@include('users._table')
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|