anomadev's avatar

¿how use laravel-excel on lumen? i have a problem with the service provider

I have a error with the config_path helper

0 likes
5 replies
anomadev's avatar

Sure !!

composer.json:

"maatwebsite/excel": "~2.0.0"

bootstrap/app.php:

class_alias('Maatwebsite\Excel\Facades\Excel', 'Excel');
$app->withFacades();
$app->register('Maatwebsite\Excel\ExcelServiceProvider');

Error:

Fatal error: Call to undefined function Maatwebsite\Excel\config_path() in C:\xampp\htdocs\lumen\vendor\maatwebsite\excel\src\Maatwebsite\Excel\ExcelServiceProvider.php on line 45

ExcelServiceProvider.php on line 45:

$this->publishes([
      __DIR__ . '/../../config/excel.php' => config_path('excel.php'),
]);

thanks for the help.

bobbybouwmann's avatar

Did you create the config file in the config directory? It's looking for a config file! Also some packages don't fully support Lumen and are pointed to Laravel only!

bashy's avatar

There's no config folder in Lumen. Thus there's no config_path() function.

Please or to participate in this conversation.