To change the table names used by Filament's import functionality, you will need to perform a few steps. Here's a solution that should help you achieve your goal:
-
Publish Filament's Migration Files: First, you need to publish the migration files for the import tables to your application so that you can modify them.
php artisan vendor:publish --tag="filament-migrations" -
Rename the Tables in the Migration Files: Locate the migration files for the
importsandfailed_import_rowstables in yourdatabase/migrationsdirectory. Rename the tables within these migration files tomvl_importsandmvl_failed_import_rowsrespectively.For example, in the
importstable migration:Schema::create('mvl_imports', function (Blueprint $table) { // ... });And in the
failed_import_rowstable migration:Schema::create('mvl_failed_import_rows', function (Blueprint $table) { // ... }); -
Update the Model Table Names: If Filament uses Eloquent models for these tables, you will need to update the
$tableproperty in each model to reflect the new table names.For the
Importmodel:class Import extends Model { protected $table = 'mvl_imports'; // ... }For the
FailedImportRowmodel:class FailedImportRow extends Model { protected $table = 'mvl_failed_import_rows'; // ... } -
Run the Migrations: After updating the migration files, run the migrations to create the new tables with the correct names.
php artisan migrate -
Update Filament Configuration (if necessary): If Filament provides a configuration file where these table names are referenced, you will need to publish the configuration file and update the table names there as well.
php artisan vendor:publish --tag="filament-config"Then, in the published configuration file (usually
config/filament.php), update the table names:'imports' => [ 'table' => 'mvl_imports', // ... ], 'failed_import_rows' => [ 'table' => 'mvl_failed_import_rows', // ... ], -
Review Any Custom Code: If you have any custom code that references the original table names, make sure to update those references to the new table names.
By following these steps, you should be able to successfully change the table names used by Filament's import functionality to mvl_imports and mvl_failed_import_rows. Make sure to test the import functionality thoroughly after making these changes to ensure everything is working as expected.