What did you try so far?
For reading the XLS you can use one of the following packages:
- https://github.com/spatie/simple-excel (only xlsx, not xls)
- https://laravel-excel.com
The last one has an upsert strategy build in explained in the docs: https://docs.laravel-excel.com/3.1/imports/model.html#upserting-models
If you don't want to use the laravel-excel.com package you can handle upserting (update or insert) your self. Laravel has a build in method for this see: https://laravel.com/docs/9.x/eloquent#upserts
The only thing left is to delete records that are not available in your XLS. The simplest solution would be to keep track of all the ids that you inserted or updated in your XLS and at the end run a query: DELETE FROM your_table where id NOT IN (1,2,3,4). Where 1, 2, 3 and 4 are the ids that were updated or inserted.
But be careful with the 'delete', if you or someone uploaded an xls that is not correct you might delete all of your records by accident.
Alternatively you could add an last_updated_at column to your database and update it each time the XLS is processed. And then if you are OK with everything you could say: delete all records which were not updated in the last 24 hours.