Skip to content

Commit 1093962

Browse files
committed
🚧 wip
1 parent 5e34030 commit 1093962

File tree

9 files changed

+563
-294
lines changed

9 files changed

+563
-294
lines changed

app/Filament/Pages/Dashboard.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Filament\Pages;
4+
5+
use App\Filament\Widgets\BlogPostsOverview;
6+
use Filament\Pages\Dashboard as BasePage;
7+
8+
class Dashboard extends BasePage
9+
{
10+
protected function getWidgets(): array
11+
{
12+
return [
13+
BlogPostsOverview::class,
14+
];
15+
}
16+
17+
protected function getColumns(): int | array
18+
{
19+
return 5;
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Filament\Widgets;
4+
5+
use App\Models\Article;
6+
use Filament\Widgets\Widget;
7+
use Illuminate\Support\Facades\Cache;
8+
9+
class BlogPostsOverview extends Widget
10+
{
11+
protected static string $view = 'filament.widgets.blog-posts-overview';
12+
13+
protected int | string | array $columnSpan = 5;
14+
15+
protected function getViewData(): array
16+
{
17+
$latestArticles = Cache::remember('last-posts', now()->addHour(), fn () => Article::latest()->limit(3)->get());
18+
19+
return [
20+
'latestArticles' => $latestArticles,
21+
];
22+
}
23+
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"yarri/link-finder": "^2.7"
5454
},
5555
"require-dev": {
56+
"barryvdh/laravel-debugbar": "^3.7",
5657
"barryvdh/laravel-ide-helper": "^2.12",
5758
"brianium/paratest": "^6.3",
5859
"fakerphp/faker": "^1.9.1",

composer.lock

Lines changed: 151 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/filament.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
'namespace' => 'App\\Filament\\Pages',
106106
'path' => app_path('Filament/Pages'),
107107
'register' => [
108-
Pages\Dashboard::class,
108+
// Pages\Dashboard::class,
109109
],
110110
],
111111

@@ -139,8 +139,8 @@
139139
'namespace' => 'App\\Filament\\Widgets',
140140
'path' => app_path('Filament/Widgets'),
141141
'register' => [
142-
Widgets\AccountWidget::class,
143-
Widgets\FilamentInfoWidget::class,
142+
// Widgets\AccountWidget::class,
143+
// Widgets\FilamentInfoWidget::class,
144144
],
145145
],
146146

0 commit comments

Comments
 (0)