Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nova 4. #36

Closed
philipbaginski opened this issue Apr 10, 2022 · 19 comments · Fixed by #37
Closed

Nova 4. #36

philipbaginski opened this issue Apr 10, 2022 · 19 comments · Fixed by #37
Labels
enhancement New feature or request

Comments

@philipbaginski
Copy link

Hi,

Is this package compatible with Laravel Nova 4?

@simonhamp
Copy link
Owner

There's nothing that should prevent it being installed in Nova 4, but I don't know if it will work though 🤷

I haven't got a reason to purchase a Nova 4 license at the moment and try it out.

Please let me know how you get on 🙂

@ali-raza-saleem
Copy link

Nova 4 added abstract function menu() in Tool.php. Since LaravelNovaCsvImport.php extends Tool.php, it necessitates the function's implementation in LaravelNovaCsvImport.php. I will be creating pull request to fix it.

@simonhamp
Copy link
Owner

@philipbaginski @the-alichemist I've been taking a look at this today... it looks like there's actually a lot more needed than I had hoped as Nova 4 is a fundamental change in the way various parts of Nova work, meaning tools need quite a bit of refactoring. I will open a PR shortly

@philipbaginski
Copy link
Author

🙏 Fingers crossed 🤞 for U.

@simonhamp simonhamp mentioned this issue Apr 17, 2022
@simonhamp
Copy link
Owner

@philipbaginski @the-alichemist I've prep'd the feature/nova-4 branch and #37. Please feel free to give this a try.

I've been testing quite a bit today and everything seems to work as expected.

I will likely release this as v0.4.0 in the coming days if I don't hear from either of you.

@philipbaginski
Copy link
Author

Trying to install with: composer require simonhamp/laravel-nova-csv-import --with-all-dependencies

, but getting error:

C:\Users\Philip\nova>composer require simonhamp/laravel-nova-csv-import --with-all-dependencies
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.3.0 for simonhamp/laravel-nova-csv-import
./composer.json has been updated
Running composer update simonhamp/laravel-nova-csv-import --with-all-dependencies
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals

  • Locking simonhamp/laravel-nova-csv-import (v0.3.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    Failed to download simonhamp/laravel-nova-csv-import from dist: C:\Users\Philip\nova\vendor/simonhamp/laravel-nova-csv-import does not exist and could not be created.
    Now trying to download from source
  • Syncing simonhamp/laravel-nova-csv-import (v0.3.0) into cache

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

[RuntimeException]
C:\Users\Philip\nova\vendor/simonhamp/laravel-nova-csv-import does not exist and could not be created.

@simonhamp
Copy link
Owner

Yeah, you'll need to explicitly require the branch as I've not released this yet.

You should change your composer.json require section to have:

"simonhamp/laravel-nova-csv-import": "dev-feature/nova-4",

Then run composer update.

@philipbaginski
Copy link
Author

philipbaginski commented Apr 18, 2022

Update in composer.json require section done, and after composer update I have got this:

C:\Users\Philip\nova>composer update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Failed to download simonhamp/laravel-nova-csv-import from dist: C:\Users\Philip\nova\vendor/simonhamp/laravel-nova-csv-import does not exist and could not be created.
Now trying to download from source

  • Syncing simonhamp/laravel-nova-csv-import (dev-feature/nova-4 81f511c) into cache

[RuntimeException]
C:\Users\Philip\nova\vendor/simonhamp/laravel-nova-csv-import does not exist and could not be created.

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] []...

@simonhamp
Copy link
Owner

simonhamp commented Apr 18, 2022

What's the value of your minimum-stability setting in your composer.json (if there is one)?

@philipbaginski
Copy link
Author

"minimum-stability": "dev",

@simonhamp
Copy link
Owner

I've just tried this on a brand new repo on my machine and it works fine - composer is happily able to fetch from GitHub and install the package on the dev-feature/nova-4 branch.

[RuntimeException]
C:\Users\Philip\nova\vendor/simonhamp/laravel-nova-csv-import does not exist and could not be created.

@philipbaginski this sounds like a permissions issue.

Not sure how that's come about, but it shouldn't be anything to do with switching to using this dev branch.

I'm not familiar with Windows permissions any more, but it may be worth checking what they are for this C:\Users\Philip\nova\ folder because it sounds like the composer executable can't create folders in vendor.

Please verify that composer is able to install other packages into this directory and fix any permissions issues before trying again.

@philipbaginski
Copy link
Author

I'm able to install other packages. I'm able to install main version of this package for Nova 3, which gives error in Nova 4. But is installed and app works.

@simonhamp
Copy link
Owner

@philipbaginski The only thing in composer that throws that exception is around folder permissions. Not quite sure why it would be fine for some packages and not others though, unless permissions for that one specific folder have been garbled by something.

Might be worth completely deleting the vendor folder and just trying composer update again.

@philipbaginski
Copy link
Author

Magic! It works :-) Package is installed and ready to test it. Thank U :-)

@philipbaginski
Copy link
Author

Last question: What kind of formats package is able to import?

@philipbaginski
Copy link
Author

Testing with simple data and related data. Simply goes smooth. Getting issue with related data. Having field BelongsTo and in the .csv file column I have a name of related model going to be saved as FK in the table I'm importing data to. And it gives an error.

@simonhamp
Copy link
Owner

@philipbaginski

Last question: What kind of formats package is able to import?

At the moment, I've only tested with CSV, but the importer can handle many formats.

I'm not sure if what I have so far will do what's needed so I maybe need to do a bit more work on that.

If it doesn't work using different formats, please feel free to open a new issue for that feature request with the details of what you need.

Getting issue with related data.

This is already a separate issue (#5). Please add your comments about this requirement to that thread instead of this Nova 4 thread.

@simonhamp simonhamp added the enhancement New feature or request label Apr 19, 2022
@voicecode-bv
Copy link

@simonhamp Thanks for your work! Just needed this for my Nova 4 projects and got it working swiftly. 👍

@simonhamp
Copy link
Owner

@voicecode-bv thats great to hear!

Given that 3 of us have now successfully installed and used the package, I think this is ready to release.

Here goes! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants