Skip to content
Advertisement

Laravel Imports: How to replace imported row value by id?

So i have this code:

PengajuanDetailController.php

JavaScript

SubmissionDetailImport.php

JavaScript

I wanted to make the imported row value of ‘submission_id’ equal to an id,

for example: http://127.0.0.1:8000/pengajuan/4/

the row value of ‘submission_id’ becomes 4 of the “/4/” instead of the original imported value, how to do?

Advertisement

Answer

You can simply pass your Url parameter, through to the importer.

JavaScript

Now we are needing the logic on the Excel Importer class. Add it as a property and define a setter for it.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement