Skip to content
Draft
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To begin, you can start Lando.
lando start
```

Now, you should be able to access the Laravel admin at `https://bison.lndo.site/`.
Now, you should be able to access the Laravel admin at `https://bison.lndo.site/dashboard`.

### **Access the Admin Panel**

Expand All @@ -45,5 +45,5 @@ Example Output:
│ •••••••• │
└──────────────────────────────────────────────────────────────┘

INFO Success! vendors@tri.be may now log in at https://bison.lndo.site/auth/login.
INFO Success! vendors@tri.be may now log in at https://bison.lndo.site/dashboard/login.
```
94 changes: 94 additions & 0 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php

namespace App\Filament\Pages;

use App\Livewire\LinksList;
use BackedEnum;
use Filament\Facades\Filament;
use Filament\Pages\Dashboard as DashboardPage;
use Filament\Widgets\AccountWidget;
use Illuminate\Contracts\Support\Htmlable;

class Dashboard extends DashboardPage
{
protected static string|BackedEnum|null $navigationIcon = 'phosphor-circles-three-plus-duotone';

protected string $view = 'filament.pages.dashboard';

public function getColumns(): array|int
{
return [
'default' => 1,
'xl' => 2,
];
}

public function getHeading(): string|Htmlable
{
return sprintf('Welcome, %s', Filament::getUserName(auth()->user()));
}

public function getSubheading(): string
{
return date('l, F jS');
}

public function getWidgets(): array
{
return [
AccountWidget::class,
];
}

public function getSidebarWidgets(): array
{
return [
LinksList::make([
'lazy' => false,
'title' => __('Quick Actions'),
'links' => [
[
'label' => 'Homepage',
'url' => config('app.url'),
'icon' => 'phosphor-house',
],
[
'label' => 'Edit Profile',
'url' => route('filament.dashboard.auth.profile'),
'icon' => 'phosphor-pencil-simple',
],
[
'label' => 'Add User',
'url' => route('filament.dashboard.resources.users.create'),
'icon' => 'phosphor-user-plus',
],
],
]),
LinksList::make([
'lazy' => false,
'buttons' => false,
'title' => __('Support'),
'links' => [
[
'label' => 'Documentation',
'url' => 'https://github.com/moderntribe/bison/wiki',
'icon' => 'phosphor-book-bookmark-duotone',
'target' => '_blank',
],
[
'label' => 'Github',
'url' => 'https://github.com/moderntribe/bison',
'icon' => 'phosphor-github-logo-duotone',
'target' => '_blank',
],
[
'label' => 'Notion',
'url' => 'https://www.notion.so/stellarwp/1c8d740aae2d407baa05fd2482e04247?v=79a64e0555d74bbda9e021c6017c5380&pvs=4',
'icon' => 'phosphor-notion-logo-duotone',
'target' => '_blank',
],
],
]),
];
}
}
26 changes: 26 additions & 0 deletions app/Livewire/LinksList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Livewire;

use Filament\Widgets\Widget;

class LinksList extends Widget
{
protected static string $view = 'livewire.links-list';

public bool $buttons = true;

public string $title = 'Links';

public array $links = [
[
'label' => 'Filament',
'url' => 'https://filamentphp.com',
],
[
'label' => 'GitHub',
'url' => 'https://github.com/',
'icon' => 'phosphor-github-logo-duotone',
],
];
}
10 changes: 9 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Permission\Traits\HasRoles;

#[ObservedBy(UserObserver::class)]
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasAvatar
{
/** @use HasFactory<UserFactory> */
use HasFactory, HasRoles, Notifiable;
use HasFactory, HasRoles, LogsActivity, Notifiable;

/**
* The attributes that are mass assignable.
Expand Down Expand Up @@ -123,6 +125,12 @@ public function getAppAuthenticationHolderName(): string
return $this->email;
}

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logOnly(['name', 'email']);
}

/**
* @return ?array<string>
*/
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"filament/spatie-laravel-settings-plugin": "^4.0",
"laravel/framework": "^12",
"laravel/tinker": "^2.9",
"spatie/laravel-activitylog": "^4.10",
"spatie/laravel-permission": "^6.10",
"stechstudio/filament-impersonate": "^4.0",
"symfony/http-client": "^7.3",
Expand Down
Loading