Closed philipbaginski closed 2 years ago
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 🙂
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.
@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
🙏 Fingers crossed 🤞 for U.
@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.
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
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.
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
.
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] [--] [
What's the value of your minimum-stability
setting in your composer.json
(if there is one)?
"minimum-stability": "dev",
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.
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.
@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.
Magic! It works :-) Package is installed and ready to test it. Thank U :-)
Last question: What kind of formats package is able to import?
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.
@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 Thanks for your work! Just needed this for my Nova 4 projects and got it working swiftly. 👍
@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! 🚀
Hi,
Is this package compatible with Laravel Nova 4?