Closed chinbang closed 2 years ago
I believe it's because of the very new update on Laravel/Passport going from 5.0.3 to 6.0.0.
Lumen-passport seems to be incompatible with this new update. The workaround that I've found on SO is to import an older version of Laravel/Passport (5.0.3) in your composer.json. The thing should look like this:
"laravel/passport": "5.0.3",
"dusterio/lumen-passport": "^0.2.6"
So I guess we have to wait for a fix in lumen-passport.
You can add helpers folder in app folder and add helpers.php file app/helpers/helpers.php inside helpers.php add
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
function config_path($path = '')
{
return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
}
}
then add this to composer.json
"autoload": {
"psr-4": {
"App\\": "app/"
},
"files": [
"app/helpers/helpers.php"
]
},
then run; composer dump-autoload, thanks!
@abdullah-abunada Thanks for the solution.
@abdullah-abunada confirming that this worked for me as well.
I follow this step
Run command $ composer create-project --prefer-dist laravel/lumen lumen-app $ cd lumen-app $ composer require dusterio/lumen-passport
Modify the bootstrap flow (bootstrap/app.php file)
// Enable Facades $app->withFacades();
// Enable Eloquent $app->withEloquent();
// Enable auth middleware (shipped with Lumen) $app->routeMiddleware([ 'auth' => App\Http\Middleware\Authenticate::class, ]);
// Finally register two service providers - original one and Lumen adapter $app->register(Laravel\Passport\PassportServiceProvider::class); $app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
After Finnish I use command $ php artisan list
It show message : In PassportServiceProvider.php line 299:
Call to undefined function Laravel\Passport\config_path()