We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i followed all the steps in the docs but i can't still get lumen passport to work, i keep getting this error:
(1/1) FatalThrowableError Call to undefined method Laravel\Lumen\Application::group()
<?php $router->get('/', function () use ($router) { return $router->app->version(); }); $router->group(['middleware' => 'auth:api'], function () use ($router) { $router->get('/user', 'UsersController@all'); $router->get('/user/{id}', 'UsersController@get'); $router->post('/user', 'UsersController@add'); $router->put('/user/{id}', 'UsersController@put'); $router->delete('/user/{id}', 'UsersController@remove'); });
public function boot() { LumenPassport::routes($this->app); } }
<?php require_once __DIR__.'/../vendor/autoload.php'; try { (new Dotenv\Dotenv(__DIR__.'/../'))->load(); } catch (Dotenv\Exception\InvalidPathException $e) { // } $app = new Laravel\Lumen\Application( realpath(__DIR__.'/../') ); $app->configure('auth'); $app->withFacades(); $app->withEloquent(); $app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, App\Exceptions\Handler::class ); $app->singleton( Illuminate\Contracts\Console\Kernel::class, App\Console\Kernel::class ); // $app->middleware([ // App\Http\Middleware\ExampleMiddleware::class // ]); $app->routeMiddleware([ 'auth' => App\Http\Middleware\Authenticate::class, ]); $app->register(App\Providers\AppServiceProvider::class); // $app->register(App\Providers\AuthServiceProvider::class); // $app->register(App\Providers\EventServiceProvider::class); $app->register(Laravel\Passport\PassportServiceProvider::class); $app->register(Dusterio\LumenPassport\PassportServiceProvider::class); Dusterio\LumenPassport\LumenPassport::routes($app); Dusterio\LumenPassport\LumenPassport::routes($app, ['prefix'=> 'api/v1']); $app->router->group([ 'namespace' => 'App\Http\Controllers', ], function ($router) { require __DIR__.'/../routes/web.php'; }); return $app;
<?php return [ 'defaults' => [ 'guard' => 'api', 'passwords' => 'users', ], 'guards' => [ 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ], 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => \App\Models\User::class ] ] ];
The text was updated successfully, but these errors were encountered:
Hey! You should send $this->app->router instead of $this->app because group method dose not exists for Laravel\Lumen\Application class.
public function boot() { LumenPassport::routes($this->app->router); }
So I Belive this will fix your issue.
Sorry, something went wrong.
same here
@varyandeveloper thanks
Successfully merging a pull request may close this issue.
i followed all the steps in the docs but i can't still get lumen passport to work,
i keep getting this error:
my routes/web.php looks like so
my app/provider/AuthServiceProvider.php
my bootstrap/web.php looks like this
config/auth.php
The text was updated successfully, but these errors were encountered: