Skip to content

Commit

Permalink
Filament user trait and result stats error (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjustesen authored Sep 28, 2022
1 parent f122b9d commit a0077d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class StatsOverview extends BaseWidget
protected function getCards(): array
{
return [
Card::make('Latest download', formatBytes(Result::latest()->first()->download)),
Card::make('Latest upload', formatBytes(Result::latest()->first()->upload)),
Card::make('Latest ping', round(Result::latest()->first()->ping, 2)),
Card::make('Latest download', formatBytes(Result::latest()->first()?->download ?: 0)),
Card::make('Latest upload', formatBytes(Result::latest()->first()?->upload ?: 0)),
Card::make('Latest ping', round(Result::latest()->first()?->ping ?: 0, 2)),
];
}
}
4 changes: 3 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
namespace App\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;

use Filament\Models\Contracts\FilamentUser;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
class User extends Authenticatable implements FilamentUser
{
use HasApiTokens, HasFactory, Notifiable;

Expand Down

0 comments on commit a0077d0

Please sign in to comment.