Jr.Pikong
Jr.Pikong
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
@Dennis Koch this is my detail log error: https://flareapp.io/share/353gO6W5
12 replies
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
in laravel.log I get error :
[2024-06-19 16:20:34] local.ERROR: Undefined array key "label" {"userId":1,"exception":"[object] (ErrorException(code: 0): Undefined array key \"label\" at /var/www/html/vendor/filament/actions/src/Concerns/CanExportRecords.php:155)
[stacktrace]
[2024-06-19 16:20:34] local.ERROR: Undefined array key "label" {"userId":1,"exception":"[object] (ErrorException(code: 0): Undefined array key \"label\" at /var/www/html/vendor/filament/actions/src/Concerns/CanExportRecords.php:155)
[stacktrace]
12 replies
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
12 replies
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
In resource I call with this action :
return $table
->headerActions([
ExportAction::make()
->exporter(TransactionAggreGateExporter::class)
->icon('heroicon-o-arrow-down-tray')
->color('primary')
->chunkSize(2000)
->formats([
ExportFormat::Xlsx,
])
->label('Export')
->fileName('SummaryReport'.now())
])
return $table
->headerActions([
ExportAction::make()
->exporter(TransactionAggreGateExporter::class)
->icon('heroicon-o-arrow-down-tray')
->color('primary')
->chunkSize(2000)
->formats([
ExportFormat::Xlsx,
])
->label('Export')
->fileName('SummaryReport'.now())
])
12 replies
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
there my code TransactionAggreGateExporter.php :
<?php

namespace App\Filament\Exports;

use App\Models\TransactionSummaryAgg;
use App\Models\TrxAggreGate;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class TransactionAggreGateExporter extends Exporter
{
protected static ?string $model = TrxAggreGate::class;

public static function getColumns(): array
{
// Fetch distinct denominations
$denominations = TransactionSummaryAgg::select('denom')
->distinct()
->pluck('denom');

// Define columns
$columns = [
ExportColumn::make('trx_date')
];

foreach ($denominations as $denom) {
$columns[] = ExportColumn::make($denom);
$columns[] = ExportColumn::make("Total_Value_{$denom}");
}
return $columns;
}

public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your trx aggre gate export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}

return $body;
}
}
<?php

namespace App\Filament\Exports;

use App\Models\TransactionSummaryAgg;
use App\Models\TrxAggreGate;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\Models\Export;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class TransactionAggreGateExporter extends Exporter
{
protected static ?string $model = TrxAggreGate::class;

public static function getColumns(): array
{
// Fetch distinct denominations
$denominations = TransactionSummaryAgg::select('denom')
->distinct()
->pluck('denom');

// Define columns
$columns = [
ExportColumn::make('trx_date')
];

foreach ($denominations as $denom) {
$columns[] = ExportColumn::make($denom);
$columns[] = ExportColumn::make("Total_Value_{$denom}");
}
return $columns;
}

public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your trx aggre gate export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}

return $body;
}
}
12 replies
FFilament
Created by Jr.Pikong on 6/15/2024 in #❓┊help
Custom Exporter Colum
my apologies for the lack of clarity on my question,
12 replies
FFilament
Created by Jr.Pikong on 5/22/2024 in #❓┊help
Export FIle Excel error create big file
No description
4 replies
FFilament
Created by Jr.Pikong on 5/22/2024 in #❓┊help
Export FIle Excel error create big file
If I check in my S3 Bucket .csv file is created complete, but no .xlsx file
4 replies
FFilament
Created by Jr.Pikong on 3/27/2024 in #❓┊help
importer S3 Get Error
Yes, that's right, as @Dennis Koch said, there was an error in the S3 bucket policy process. after I made some changes it worked. and you just need to setup FILAMENT_FILESYSTEM_DISK=s3
14 replies
FFilament
Created by Raziul Islam on 3/28/2024 in #❓┊help
Allowed memory size of 134217728 bytes exhausted
change your memory_limit = 2048M in php.ini
41 replies
FFilament
Created by NothingToSay on 2/27/2024 in #❓┊help
Select Filter for Enums
10 replies
FFilament
Created by NothingToSay on 2/27/2024 in #❓┊help
Select Filter for Enums
Maybe you could implement it like this: ->options(collect(Status::cases())->where('name', '!=', 'IN_PROCESS')->pluck('name', 'value')->toArray()), and of course, you can use whereIn() as well.
10 replies
FFilament
Created by Jr.Pikong on 2/27/2024 in #❓┊help
how to register cluster in a plugin ?
add new clusterDiscovery in our Plugin , like ; $panel->discoverClusters(in: __DIR__.'/Filament/Clusters', for: 'Namespace')
4 replies
FFilament
Created by HardFist on 2/27/2024 in #❓┊help
I have problem when upload it to Share Hosting
have you tried adding this code to the User model? public function canAcces Panel(Panel $panel): bool { return true; }
19 replies
FFilament
Created by Jr.Pikong on 2/27/2024 in #❓┊help
Add Resource in Plugin with cluster Not Show the navigation
I thing not show the navigation because not defined cluster directory discover , in the main app we use ->discoverClusters(in: app_path('Filament/Clusters'), for: 'App\\Filament\\Clusters') but in plugin, web don't use that, anyone can help ?
3 replies
FFilament
Created by HardFist on 2/27/2024 in #❓┊help
I have problem when upload it to Share Hosting
Make sure this code implement in User model public function canAccessPanel(Panel $panel): bool { return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail(); } https://filamentphp.com/docs/3.x/panels/users
19 replies
FFilament
Created by Jr.Pikong on 2/25/2024 in #❓┊help
make:resource
Up
3 replies
FFilament
Created by Jr.Pikong on 2/20/2024 in #❓┊help
Optimizing Table Load Speed
Yes, that's right, but with the optimization that has been done, I think it's ok, we can apply a smaller limit, for example, 10 data, and apply a filter. with the advantages that filament has, it can still be accepted, while waiting for the latest version of Livewire which is better.
45 replies
FFilament
Created by 👑 João on 2/21/2024 in #❓┊help
GroupBy Table Widget
try DB::raw('ANY_VALUE(COUNT(*) ) as total'),
3 replies
FFilament
Created by code eater on 12/16/2023 in #❓┊help
How do i access raw file in action modal
(Model $record)
5 replies