F
Filament4mo ago
Jessy

How to Upgrade to v3.2?

composer update php artisan filament:upgrade At php artisan about, I have: Filament Version ............... v3.1.47
19 Replies
Dennis Koch
Dennis Koch4mo ago
Probably a conflict or a constraint on the version. Try composer require filament/filament:^3.2 and see what error it outputs
Jessy
Jessy4mo ago
filament/filament v3.2.0 requires filament/actions v3.2.0 -> found filament/actions[v3.2.0] but the package is fixed to v3.1.47 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Dennis Koch
Dennis Koch4mo ago
Ah sorry, try composer require -W filament/filament:^3.2
Jessy
Jessy4mo ago
ok, now the version is v3.2.24. but I can't use Filament\Tables\Actions\ExportAction;, it says Class...not found
Dennis Koch
Dennis Koch4mo ago
Please share the exact error #✅┊rules
Jessy
Jessy4mo ago
Class "App\Filament\Exports\ProductExporter" not found
Dennis Koch
Dennis Koch4mo ago
That's a different error than you just shared Did you create the actual file that you are trying to import?
Jessy
Jessy4mo ago
I'm using in a custom page a filament table and use
use App\Filament\Exports\ProductExporter;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ExportBulkAction;

....

->headerActions([
ExportAction::make()
->exporter(ProductExporter::class)
])
->bulkActions([
ExportBulkAction::make()
->exporter(ProductExporter::class)
]);
use App\Filament\Exports\ProductExporter;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ExportBulkAction;

....

->headerActions([
ExportAction::make()
->exporter(ProductExporter::class)
])
->bulkActions([
ExportBulkAction::make()
->exporter(ProductExporter::class)
]);
Dennis Koch
Dennis Koch4mo ago
That doesn't answer my question. Did you create App\Filament\Exports\ProductExporter?
Jessy
Jessy4mo ago
no
Dennis Koch
Dennis Koch4mo ago
There's your answer 😅
Jessy
Jessy4mo ago
yeah😅 , thanks, is there an option to download the file when export? or is just saving the file in storage?
Dennis Koch
Dennis Koch4mo ago
I don't know. I haven't used the Export Action yet, but I guess a download should be the default?!
Jessy
Jessy4mo ago
This is the message I got after export and the files are in storage.
No description
SirAlyon
SirAlyon4mo ago
Jessy it doesn't download the file.. I upgraded filament for the same thing. If you are interest i did a simple table that point to the exports table (i still trying to figure out how a plugin like that can be useful btw) I did something like:
class KiidReportDownload extends BaseWidget
{
public function table(Table $table): Table
{
return $table

->poll('4s')
->query(
Exports::query()->orderBy('id', 'desc')
)
->columns([
TextColumn::make('id'),
TextColumn::make('file_name')
->label('Nome File')
->badge(),
TextColumn::make('total_rows')
->label('Righe Totali'),
TextColumn::make('successful_rows')
->label('Righe Gestute'),
])
->actions([
Action::make('Downlaod')
->label('')
->icon('heroicon-s-inbox-arrow-down')
->size('lg')
->tooltip(fn (Exports $export): string => "Scarica {$export->file_name}")

->action(function (Exports $export) {

$fullPath = "filament_exports/$export->id/$export->file_name.xlsx";

if (Storage::disk('download')->exists($fullPath)) {
return Storage::download($fullPath, $export->file_name . 'xlsx');
} else {
Notification::make()
->title('Oops! Qualcosa è andato storto..')
->danger()
->send();
}
}),
]);
}
}
class KiidReportDownload extends BaseWidget
{
public function table(Table $table): Table
{
return $table

->poll('4s')
->query(
Exports::query()->orderBy('id', 'desc')
)
->columns([
TextColumn::make('id'),
TextColumn::make('file_name')
->label('Nome File')
->badge(),
TextColumn::make('total_rows')
->label('Righe Totali'),
TextColumn::make('successful_rows')
->label('Righe Gestute'),
])
->actions([
Action::make('Downlaod')
->label('')
->icon('heroicon-s-inbox-arrow-down')
->size('lg')
->tooltip(fn (Exports $export): string => "Scarica {$export->file_name}")

->action(function (Exports $export) {

$fullPath = "filament_exports/$export->id/$export->file_name.xlsx";

if (Storage::disk('download')->exists($fullPath)) {
return Storage::download($fullPath, $export->file_name . 'xlsx');
} else {
Notification::make()
->title('Oops! Qualcosa è andato storto..')
->danger()
->send();
}
}),
]);
}
}
Jessy
Jessy4mo ago
Ty! I will try this. This is just a livewire component with extends BaseWidget?
SirAlyon
SirAlyon4mo ago
It's not. It is a table widget that I render inside a modal on the resource, but you can actually just utilize the same logic as you wish. As you can see it is attached with an Exports Model that will automatically query the exports table! Have fun 😊
Jessy
Jessy4mo ago
I've made it, with Storage::download I got an error but I use the url with redirect. And I also got an error on ExportAction(), a column is not found, but the same raws are exported with ExportBulkAction. I don't understand why ExportBulkAction works and ExportAction don't, in my case.
SirAlyon
SirAlyon4mo ago
You must "return" the download method or it won't work. For the other issue maybe put the code I'll try to help tomorrow
Want results from more Discord servers?
Add your server
More Posts
I need to access $record on Table Action formI have the following. In relation to the invoiceReadyValue form field. this is a value already storeI want to put a button next to the delete button and direct it to the address in the path, how can II will put a button here and I want it to go to the link in the path of the clicked record in a new Class "Filament\Forms\Components\XXXX" not found on remote server. Dashboard and List are working.I might have overlooked something straightforward while deploying to a new remote server on DigitalOFileUpload imageEditor replace instead of adding v1, v2 to the fileHello, I am uploading images using FileUpload and I have added the imageEditor option and it works gConcat two form fields with multiple select relationshipHey ! In a resource file, i have this ```public static function form(Form $form): Form { File upload not returning url after uploadI created a form to send a message and attach files, the files upload, but the he data that comes bacopyable table column error on production vpsi already run npm install and build on my terminal and its fine error on console browser livewirlockout user after 3 failed logins for 10 minutes?how to do lockout user after 3 failed log ins for 10 minutes?BelongsToMany TextColumn first_name last_name searchableHello, How do I make the TextColumn searchable by first_name and last_name for a belongsToMany relaSet Panel (Has Authentication) to be accessed by the PublicHi there, Would it be possible to set the Panel publicly meaning the pages there can be accessed eve