You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can set up your own views and paginate the logs using the user relationship as normal, or, if you also use my [Livewire Tables](https://github.com/rappasoft/laravel-livewire-tables) plugin then here is an example table:
180
+
181
+
**Note:** This example uses the `jenssegers/agent` package which is included by default with Laravel Jetstream as well as `jamesmills/laravel-timezone` for displaying timezones in the users local timezone. Both are optional, modify the table to fit your needs.
182
+
183
+
```php
184
+
<?php
185
+
186
+
namespace App\Http\Livewire;
187
+
188
+
use App\Models\User;
189
+
use Illuminate\Database\Eloquent\Builder;
190
+
use Jenssegers\Agent\Agent;
191
+
use Rappasoft\LaravelLivewireTables\DataTableComponent;
192
+
use Rappasoft\LaravelLivewireTables\Views\Column;
193
+
use Rappasoft\LaravelAuthenticationLog\Models\AuthenticationLog as Log;
194
+
195
+
class AuthenticationLog extends DataTableComponent
196
+
{
197
+
public string $defaultSortColumn = 'login_at';
198
+
public string $defaultSortDirection = 'desc';
199
+
public string $tableName = 'authentication-log-table';
200
+
201
+
public User $user;
202
+
203
+
public function mount(User $user)
204
+
{
205
+
if (! auth()->user() || ! auth()->user()->isAdmin()) {
0 commit comments