From 08cbdafac17ca19b8bd57f0dbdc9d18f5e706e15 Mon Sep 17 00:00:00 2001 From: RamaTaufik Date: Mon, 2 Sep 2024 10:22:25 +0700 Subject: [PATCH] Adjust: Partner dashboard --- app/Filament/Partner/Resources/ReportResource.php | 1 + .../Partner/Resources/ReportResource/Pages/ViewReport.php | 7 +++++++ app/Filament/Partner/Widgets/ReportTableWidget.php | 3 ++- public/css/custom.css | 4 ++++ resources/views/filament/partner/pages/dashboard.blade.php | 5 ++++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Filament/Partner/Resources/ReportResource.php b/app/Filament/Partner/Resources/ReportResource.php index be3820f..5baf58f 100644 --- a/app/Filament/Partner/Resources/ReportResource.php +++ b/app/Filament/Partner/Resources/ReportResource.php @@ -132,6 +132,7 @@ public static function table(Table $table): Table ->actions([ // Tables\Actions\EditAction::make(), Tables\Actions\ViewAction::make(), + Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ diff --git a/app/Filament/Partner/Resources/ReportResource/Pages/ViewReport.php b/app/Filament/Partner/Resources/ReportResource/Pages/ViewReport.php index b7757e5..1896619 100644 --- a/app/Filament/Partner/Resources/ReportResource/Pages/ViewReport.php +++ b/app/Filament/Partner/Resources/ReportResource/Pages/ViewReport.php @@ -9,4 +9,11 @@ class ViewReport extends ViewRecord { protected static string $resource = ReportResource::class; + + protected function getHeaderActions(): array + { + return [ + Actions\EditAction::make(), + ]; + } } diff --git a/app/Filament/Partner/Widgets/ReportTableWidget.php b/app/Filament/Partner/Widgets/ReportTableWidget.php index 93ad342..e052455 100644 --- a/app/Filament/Partner/Widgets/ReportTableWidget.php +++ b/app/Filament/Partner/Widgets/ReportTableWidget.php @@ -5,6 +5,7 @@ use App\Models\Report; use Filament\Tables; use Filament\Tables\Table; +use Illuminate\Database\Eloquent\Builder; use Filament\Widgets\TableWidget as BaseWidget; class ReportTableWidget extends BaseWidget @@ -14,7 +15,7 @@ public function table(Table $table): Table { return $table ->query( - Report::query() + Report::query()->where('partner_id', auth()->user()->partner->id) ) ->columns([ Tables\Columns\TextColumn::make('title') diff --git a/public/css/custom.css b/public/css/custom.css index 831fbff..0998431 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -89,6 +89,10 @@ padding: 15px 20px 15px 20px; border-radius: 10px; } +.btn-orange { + background-color: #FF6E01; + color: #ffffff; +} .btn-white-outline { background-color: rgba(0,0,0,0); color: #ffffff; diff --git a/resources/views/filament/partner/pages/dashboard.blade.php b/resources/views/filament/partner/pages/dashboard.blade.php index d7e46ad..eb0380b 100644 --- a/resources/views/filament/partner/pages/dashboard.blade.php +++ b/resources/views/filament/partner/pages/dashboard.blade.php @@ -54,7 +54,10 @@ - Buat Laporan +
+

Laporan Mitra

+ Buat Laporan +
{{-- add widgets --}}