Php POS script gives Server error when downloading excel file of products

sharing a error log, if anybody can guide in simple terms. thanks in advance

live.ERROR: Call to a member function pluck() on null {"userId":1,"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function pluck() on null at /home/user/domains/ /public_html/shop/app/Exports/ProductsExport.php:25) [stacktrace] #0 /home/user/domains/ /public_html/shop/vendor/maatwebsite/excel/src/Sheet.php(484): App\Exports\ProductsExport->array() #1 /home/user/domains/ /public_html/shop/vendor/maatwebsite/excel/src/Sheet.php(223): Maatwebsite\Excel\Sheet->fromArray(Object(App\Exports\ProductsExport)) #2 /home/user/domains/ /public_html/shop/vendor/maatwebsite/excel/src/Writer.php(71): Maatwebsite\Excel\Sheet->export(Object(App\Exports\ProductsExport)) #3 /home/user/domains/ /public_html/shop/vendor/maatwebsite/excel/src/Excel.php(195): Maatwebsite\Excel\Writer->export(Object(App\Exports\ProductsExport), 'Xlsx') #4 /home/user/domains/ /public_html/shop/vendor/maatwebsite/excel/src/Excel.php(84): Maatwebsite\Excel\Excel->export(Object(App\Exports\ProductsExport), 'products-export...', 'Xlsx') #5 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(239): Maatwebsite\Excel\Excel->download(Object(App\Exports\ProductsExport), 'products-export...') #6 /home/user/domains/ /public_html/shop/app/Http/Controllers/ProductController.php(2333): Illuminate\Support\Facades\Facade::__callStatic('download', Array) #7 [internal function]: App\Http\Controllers\ProductController->downloadExcel() #8 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #9 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('downloadExcel', Array) #10 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\ProductController), 'downloadExcel') #11 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController() #12 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run() #13 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #14 /home/user/domains/ /public_html/shop/app/Http/Middleware/CheckUserLogin.php(22): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #15 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\CheckUserLogin->handle(Object(Illuminate\Http\Request), Object(Closure)) #16 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #17 /home/user/domains/ /public_html/shop/app/Http/Middleware/AdminSidebarMenu.php(774): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #18 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\AdminSidebarMenu->handle(Object(Illuminate\Http\Request), Object(Closure)) #19 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #20 /home/user/domains/ /public_html/shop/app/Http/Middleware/Timezone.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #21 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\Timezone->handle(Object(Illuminate\Http\Request), Object(Closure)) #22 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #23 /home/user/domains/ /public_html/shop/app/Http/Middleware/Language.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #24 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\Language->handle(Object(Illuminate\Http\Request), Object(Closure)) #25 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #26 /home/user/domains/ /public_html/shop/app/Http/Middleware/SetSessionData.php(53): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #27 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\SetSessionData->handle(Object(Illuminate\Http\Request), Object(Closure)) #28 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #29 /home/user/domains/ /public_html/shop/app/Http/Middleware/IsInstalled.php(51): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #30 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): App\Http\Middleware\IsInstalled->handle(Object(Illuminate\Http\Request), Object(Closure)) #31 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #32 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #33 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure)) #34 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #35 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #36 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure)) #37 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #38 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #39 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #40 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #41 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #42 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #43 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #44 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #45 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #46 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #47 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #48 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #49 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #50 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #51 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #52 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #53 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #54 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #55 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Router.php(657): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #56 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route)) #57 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Router.php(612): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #58 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #59 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request)) #60 /home/user/domains/ /public_html/shop/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(58): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #61 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Object(Illuminate\Http\Request), Object(Closure)) #62 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #63 /home/user/domains/ /public_html/shop/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #64 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure)) #65 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #66 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #67 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #68 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #69 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #70 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #71 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #72 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #73 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure)) #74 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #75 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #76 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #77 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #78 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #79 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #80 /home/user/domains/ /public_html/shop/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #81 /home/user/domains/ /public_html/shop/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #82 {main} "}

now posted a complete error log. this is hosting based POS for retail business, in its products page it shows option to download complete products list in excel form, as i press the button screen shows 500 server error. want to resolve this problem.



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation