Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Pass parameter to Import Class #20

Open
arditokshtuni opened this issue Feb 14, 2019 · 3 comments
Open

Pass parameter to Import Class #20

arditokshtuni opened this issue Feb 14, 2019 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arditokshtuni
Copy link

Is this possible?

I have Cities that hasMany Users and User belongsTo a City.
I want to have an import card onlyInDetail of City resource that say Import Users.
And now, in excel file i do not want to include the city_id, i need to pass as parameter so all Users imported will belong to the City that the Import is executed.

In documentation what your package use is just the full path of class using Namespace: App\Imports\UserImport::class or 'App\Imports\UserImport'
Instead i want: new UserImport($city_id); lets say

If this is possible please tell me how to pass the parameter, if not, it will be great to have this as feature.

Thank you, great package btw

@Sparclex Sparclex added enhancement New feature or request good first issue Good for newcomers labels Mar 12, 2019
@Sparclex
Copy link
Owner

I would be happy to accept a PR which implements this feature.

@dtannen
Copy link

dtannen commented Apr 3, 2019

Please implement someone!

@dtannen
Copy link

dtannen commented Apr 4, 2019

If I just have access to the base NovaRequest in my custom importer- it will resolve my issue. Please accept my pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants