Comments (8)
@Kussie seems your issue is also related to the usage of epartment/nova-dependency-container/src/Http/Requests/ActionRequest.php
package.
nova-dependency-container
doesn't seem compatible with Nova 4
from laravel-nova-excel.
You should add the default value as null in "public function fields(NovaRequest $request = null)" for your Action
from laravel-nova-excel.
@Kussie It doesn't seem you are on 1.3.0 of this package. This exact error was fixed here 1447e75 and tagged as 1.3.0
from laravel-nova-excel.
@patrickbrouwers I'm on version 1.3.1 and have same error
from laravel-nova-excel.
@hossam-hani can you share the output of composer show maatwebsite/laravel-nova-excel
and the full stack trace of the error please.
from laravel-nova-excel.
`name : maatwebsite/laravel-nova-excel
descrip. : Supercharged Excel exports for Laravel Nova Resources
keywords : PHPExcel, actions, laravel, laravel-nova, nova, phpspreadsheet
versions : * 1.3.1
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source : [git] https://github.com/SpartnerNL/Laravel-Nova-Excel.git 860daaf
dist : [zip] https://api.github.com/repos/SpartnerNL/Laravel-Nova-Excel/zipball/860daaf6160472558ac754ab3c4fe856a46a9722 860daaf
path : /Users/hossam/Desktop/projects/rizme_shop2/vendor/maatwebsite/laravel-nova-excel
names : maatwebsite/laravel-nova-excel
support
issues : https://github.com/SpartnerNL/Laravel-Nova-Excel/issues
source : https://github.com/SpartnerNL/Laravel-Nova-Excel/tree/1.3.1
autoload
psr-4
Maatwebsite\LaravelNovaExcel\ => src/
requires
laravel/nova ^4.0
laravie/serialize-queries ^1.0|^2.0
maatwebsite/excel ^3.1
php >=7.1.0
`
[2022-04-20 18:00:27] local.ERROR: Too few arguments to function Laravel\Nova\Actions\ExportAsCsv::fields(), 0 passed in /Users/hossam/Desktop/projects/projectnam/vendor/epartment/nova-dependency-container/src/Http/Requests/ActionRequest.php on line 21 and exactly 1 expected {"userId":1,"exception":"[object] (ArgumentCountError(code: 0): Too few arguments to function Laravel\\Nova\\Actions\\ExportAsCsv::fields(), 0 passed in /Users/hossam/Desktop/projects/projectnam/vendor/epartment/nova-dependency-container/src/Http/Requests/ActionRequest.php on line 21 and exactly 1 expected at /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Actions/ExportAsCsv.php:78) [stacktrace] #0 /Users/hossam/Desktop/projects/projectnam/vendor/epartment/nova-dependency-container/src/Http/Requests/ActionRequest.php(21): Laravel\\Nova\\Actions\\ExportAsCsv->fields() #1 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Controllers/ActionController.php(44): Epartment\\NovaDependencyContainer\\Http\\Requests\\ActionRequest->validateFields() #2 /Users/hossam/Desktop/projects/projectnam/vendor/epartment/nova-dependency-container/src/Http/Controllers/ActionController.php(21): Laravel\\Nova\\Http\\Controllers\\ActionController->store(Object(Epartment\\NovaDependencyContainer\\Http\\Requests\\ActionRequest)) #3 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Epartment\\NovaDependencyContainer\\Http\\Controllers\\ActionController->store(Object(Epartment\\NovaDependencyContainer\\Http\\Requests\\ActionRequest), 'customers') #4 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('store', Array) #5 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Epartment\\NovaDependencyContainer\\Http\\Controllers\\ActionController), 'store') #6 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController() #7 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run() #8 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #9 /Users/hossam/Desktop/projects/projectnam/vendor/itsmejoshua/novaspatiepermissions/src/ForgetCachedPermissions.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #10 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Itsmejoshua\\Novaspatiepermissions\\ForgetCachedPermissions->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #11 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Middleware/Authorize.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #12 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #13 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Middleware/BootTools.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #14 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\BootTools->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #15 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #16 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #17 /Users/hossam/Desktop/projects/projectnam/vendor/inertiajs/inertia-laravel/src/Middleware.php(88): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #18 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Inertia\\Middleware->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #19 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #20 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #21 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #22 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Middleware/Authenticate.php(31): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #23 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #24 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #25 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #26 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #27 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #28 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(58): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #29 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\AuthenticateSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #30 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #31 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure)) #32 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #33 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #34 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #35 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #36 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #37 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #38 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #39 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #40 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #41 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #42 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #43 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #44 /Users/hossam/Desktop/projects/projectnam/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #45 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\\DisableBrowserCache->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #46 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/nova/src/Http/Middleware/ServeNova.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #47 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #48 /Users/hossam/Desktop/projects/projectnam/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #49 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #50 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #51 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #52 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #53 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #54 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #55 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #56 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #57 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #58 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #59 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #60 /Users/hossam/Desktop/projects/projectnam/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #61 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #62 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #63 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #64 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #65 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #66 /Users/hossam/Desktop/projects/projectnam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #67 /Users/hossam/Desktop/projects/projectnam/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #68 /Users/hossam/Desktop/projects/projectnam/server.php(21): require_once('/Users/hossam/D...') #69 {main} "}
from laravel-nova-excel.
@hossam-hani your stacktrace shows that you are not using the export action from this package but Too few arguments to function Laravel\Nova\Actions\ExportAsCsv::fields()
.
Looking further down the stack trace it seems to have to do something with this package: epartment/nova-dependency-container/src/Http/Requests/ActionRequest.php(21)
from laravel-nova-excel.
thank you that's helped me a lot
from laravel-nova-excel.
Related Issues (20)
- QueuedExport doesn't allow softDeleted data HOT 10
- FileNotFound after upgrade HOT 3
- [BUG] ExportResourceActionRequest::forAllMatchingResources in Nova 4.0 HOT 4
- QUESTION: how to include columns and extra rows from related resources HOT 10
- [QUESTION] How to export a nova resource to excel WITHOUT actions?
- [BUG] Error in Nova 4 when trying to use actions in lenses HOT 1
- [PROPOSAL] Implement strict null comparison
- "Select all"-download doesn't work HOT 9
- [BUG] MemoryCache class methods incompatible with Psr\SimpleCache\CacheInterface HOT 2
- Excel is failed to download in laravel nova HOT 2
- Cannot download excel sheet in forge server HOT 2
- [BUG] Crash with Nova 4.24.0; parameter type declaration mismatch in withName HOT 3
- Belogs to
- Select All via Relationship table Exports Entire Resource
- How to access the Resource/Model in the Query? HOT 1
- [BUG] No longer works with the latest version of Laravel Nova (4.32.9) HOT 3
- How to get Select field displayUsingLabels instead of value!
- [BUG] nova 4.33: Post 404 not found HOT 4
- [QUESTION] How to export multiple sheets?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-nova-excel.