filament/actions
v3.2.124
v11.
No response
PHP 8.3.11
In my project similar to the one I share here I have found a bug in the case of working with a HasTenant project, I integrated the export options in both my admin and customer panels and in these cases it does not work, it does not perform the download, I tried it for a single panel project that is not a tenant and it works perfectly, but in the case of a saas tenant it does not work.
Perform several tests changing the relationship in the exports migration
public function up(): void
{
Schema::create('exports', function (Blueprint $table) {
$table->id();
$table->timestamp('completed_at')->nullable();
$table->string('file_disk');
$table->string('file_name')->nullable();
$table->string('exporter');
$table->unsignedInteger('processed_rows')->default(0);
$table->unsignedInteger('total_rows');
$table->unsignedInteger('successful_rows')->default(0);
$table->foreignId('customer_id')->constrained()->cascadeOnDelete();
$table->timestamps();
});
}
But it still doesn't work, in these cases it should be taken from the customer, who is the CompanyPanel user, but nothing happens, I did another test adding the ExportAction button in the AdminPanel and it doesn't download either, in short it works 100% for a panel app that is not of the tenant type.
On the other hand, when I made these changes to use customer_id and do an export, it gave me an error
However, if you check the image you will see that it is still expecting a user_id
to exist in the insert, but I updated it to customer_id
, which makes me think that somewhere it is taking the migration configuration of the filament package and not the migration of the laravel project
Also in the case of my other project I applied the use of relationships ( ExportColumn::make('companies.name'),
) but it doesn't solve the problem either.
public static function getColumns(): array
{
return [
ExportColumn::make('id')
->label('ID'),
ExportColumn::make('nombre'),
ExportColumn::make('description'),
ExportColumn::make('valor'),
ExportColumn::make('rangeuntil'),
ExportColumn::make('availabledays'),
ExportColumn::make('disponibilidad'),
ExportColumn::make('companies.name'),
ExportColumn::make('created_at'),
ExportColumn::make('updated_at'),
];
}
What is expected is that it downloads the excel file without any problem when it is a project that uses HasTenant, that the fact that it is a tenant project is not a limitation to be able to use the filament library.
1.- Clone the project
2.- Install the dependencies
3.- Excecute the migrations with the seed flag to insert the seed data php artisan migrate:fresh --seed
4.- Go to url the /admin/login
panel with the user registered in the seeder database/seeders/DatabaseSeeder
[email protected]
and the password password
5.- Create a client and assign the administrator role, then click to vincular assign a companies.
Here you can go to Permissions and try to download or export Excel and it will not work in said panel.
6.- Then to test in the Customer panel you can go to /gym/login
and log in with the created clientes account, go to alumnos and create an alumnos account and try to download the excel in the table, and it cannot be downloaded either.
https://github.com/TranceDevCode/saasmyfit
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too