ocram82
ocram82
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
ok thanks a lot! i will try and get you back some feedback
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
one pdf with user data for different users
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
what code i have to use? i just use an export action to export csv and i make this:
->headerActions([
ExportAction::make()
->exporter(UserExporter::class)
->formats([
ExportFormat::Csv,
])
->fileDisk('local')
->label('Export')
->icon('heroicon-o-document-text')
->color('primary')
->before(function (ModelsResource $resource) {
$resource->deleteOldExports();
}),

]);
->headerActions([
ExportAction::make()
->exporter(UserExporter::class)
->formats([
ExportFormat::Csv,
])
->fileDisk('local')
->label('Export')
->icon('heroicon-o-document-text')
->color('primary')
->before(function (ModelsResource $resource) {
$resource->deleteOldExports();
}),

]);
Do you mean this?
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
no ok, this is for a single user, but the nice to have is a bulk action
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
No description
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
yes for sure, but what i have to put in it? i have to dispatch a job that build pdf?
18 replies
FFilament
Created by ocram82 on 9/12/2023 in #❓┊help
Enum TextColumn badge() with label, icon and color
happy to hear that 👍
8 replies
FFilament
Created by ocram82 on 9/12/2023 in #❓┊help
Enum TextColumn badge() with label, icon and color
this is the complete code of the enum:
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum SubstitutionStatusEnum: string implements HasColor, HasIcon, HasLabel
{
case Suspended = 'suspended';
case Accepted = 'accepted';
case Rejected = 'rejected';

public function getColor(): string|array|null
{
return match ($this) {
self::Suspended => 'primary',
self::Accepted => 'success',
self::Rejected => 'danger',
};
}

public function getIcon(): ?string
{
return match ($this) {
self::Suspended => 'heroicon-o-ellipsis-horizontal-circle',
self::Accepted => 'heroicon-o-check-circle',
self::Rejected => 'heroicon-o-x-circle',
};
}

public function getLabel(): ?string
{
return match ($this) {
self::Suspended => 'Sospesa',
self::Accepted => 'Accettata',
self::Rejected => 'Rifiutata',
};
}
}
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum SubstitutionStatusEnum: string implements HasColor, HasIcon, HasLabel
{
case Suspended = 'suspended';
case Accepted = 'accepted';
case Rejected = 'rejected';

public function getColor(): string|array|null
{
return match ($this) {
self::Suspended => 'primary',
self::Accepted => 'success',
self::Rejected => 'danger',
};
}

public function getIcon(): ?string
{
return match ($this) {
self::Suspended => 'heroicon-o-ellipsis-horizontal-circle',
self::Accepted => 'heroicon-o-check-circle',
self::Rejected => 'heroicon-o-x-circle',
};
}

public function getLabel(): ?string
{
return match ($this) {
self::Suspended => 'Sospesa',
self::Accepted => 'Accettata',
self::Rejected => 'Rifiutata',
};
}
}
8 replies
FFilament
Created by Prosp30 on 1/28/2024 in #❓┊help
Reset password email locale
Hi all, this case was solved? i'm in the same situation....what i have to put in lang file? I need to translate the password reset text mail in italian
6 replies
FFilament
Created by ocram82 on 5/31/2024 in #❓┊help
FileUpload edit picsum.photos
perfect, thanks
5 replies
FFilament
Created by ocram82 on 5/24/2024 in #❓┊help
ImageEntry relationship get url
a little update, i try to use $state here ->url(fn ($state) => Storage::url($state), shouldOpenInNewTab: true) but state contains the array of name attributes of all relationship items. There is a way to indicize it?
3 replies
FFilament
Created by ocram82 on 5/20/2024 in #❓┊help
ExportAction download file on Digital Ocean Spaces
A little update, maybe someone can give a suggest on this. The problem is in this file: /vendor/filament/actions/src/Exports/Downloaders/CsvDownloader.php
<?php

namespace Filament\Actions\Exports\Downloaders;

use Filament\Actions\Exports\Downloaders\Contracts\Downloader;
use Filament\Actions\Exports\Models\Export;
use Symfony\Component\HttpFoundation\StreamedResponse;

class CsvDownloader implements Downloader
{
public function __invoke(Export $export): StreamedResponse
{
$disk = $export->getFileDisk();
$directory = $export->getFileDirectory();

if (! $disk->exists($directory)) {
abort(404);
}
...
<?php

namespace Filament\Actions\Exports\Downloaders;

use Filament\Actions\Exports\Downloaders\Contracts\Downloader;
use Filament\Actions\Exports\Models\Export;
use Symfony\Component\HttpFoundation\StreamedResponse;

class CsvDownloader implements Downloader
{
public function __invoke(Export $export): StreamedResponse
{
$disk = $export->getFileDisk();
$directory = $export->getFileDirectory();

if (! $disk->exists($directory)) {
abort(404);
}
...
This check fails if (! $disk->exists($directory)) { because Filament can't see Digital Ocean bucket as a "path". This is how i saw. Any suggestion on this?
3 replies
FFilament
Created by ocram82 on 4/8/2024 in #❓┊help
Export download link
thanks a lot. Now i'm trying to have the same behaviour but with s3 disk...the download link don't work. i've an issue:
11 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
and s3 are configured with DO Spaces data
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
because i set FILAMENT_FILESYSTEM_DISK=s3
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
sorry, yes, I wanted to explain the whole process until it broke
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
i' don't know if is because i have filament_exports folder inside a staging folder....maybe?
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
exactly
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
when i click on download link i obtain this
18 replies
FFilament
Created by Jap on 5/20/2024 in #❓┊help
Modify Export Action download URL link
yes, it works, i mean that i'm using Digital Ocean Spaces for store my files and effectively after export click, a folder named with a number /8 for example was created on it. So now i've a folder with 2 csv files and a headers.csv file inside the /8 folder on Digital Ocean Spaces. After that i see that the bell notification show 1. I click there and the download link (see pics) don't work because they are like: http://localhost/filament/exports/1/download?format=csv
18 replies