A product spreadsheet can carry a business for a long time. Moving it into a Laravel app is worthwhile when staff need to find, update and review the same records in one place. Filament’s CSV import action gives you a starting point for bringing the existing data across.
1. Define the columns and the matching key
Start with a small CSV exported from the spreadsheet. Here is a sample product file with made-up records.
sku,name,unit_price_npr
BAG-001,Canvas tote,750.00
BAG-002,Travel pouch,450.00Choose a stable key such as sku. Keep it as text in the spreadsheet, particularly if identifiers contain leading zeroes. Decide how to handle blank prices, duplicate SKUs and rows that disagree with the application’s current data. Review those rules with whoever maintains the catalog before the import.
2. Add the importer in Filament
In Filament 5, generate a product importer with php artisan make:filament-importer Product. Define the allowed columns and attach the importer to an ImportAction on the products table. Users can map CSV headers during upload, so a header such as unit_price_npr can map to your app’s price field.
Require a SKU and product name, validate the price as a nonnegative amount, and check that your database column can store the required precision. Keep the money unit consistent. For example, convert rupees to paisa explicitly if the application stores amounts in minor units.
3. Decide what happens on a second import
Filament creates a new record for each row by default. If staff will upload revised files, use the importer’s resolveRecord() method to look up an existing product by SKU. Enforce that key with a database constraint. For a multi-company app, scope the lookup and uniqueness to the company. Importing does not automatically check model policies, so enforce who can import and which records they can update.
4. Run a small test before the full import
Try a valid row, a missing SKU, an invalid price and a duplicate SKU in a test environment.
Run the file twice and compare the counts and changed fields with the intended behavior.
Check that the import queue processes jobs and that the operator can review and download failed rows.
Reconcile a few imported records against the source sheet before switching staff to the application.
Filament uses Laravel job batches and database notifications for this workflow. Check the required migrations and worker setup in the Filament import documentation.
If you’re replacing spreadsheets with an internal tool, write down who enters records, who reviews changes and what reports they need. You can see how those questions fit into my Laravel and Filament development service and the planning notes for the manpower accounting application.