Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Oauth2 Server Laravel Laravel Package

lucadegasperi/oauth2-server-laravel

View on GitHub
Deep Wiki
Context7

Lumen

Composer is the recommended way to install this package. Add the following line to your composer.json file:

"lucadegasperi/oauth2-server-laravel": "^5.0"

Then run composer update to get the package.

Register package

In your bootstrap/app.php register service providers

$app->register(\LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider::class);
$app->register(\LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider::class);

... and middleware

$app->middleware([
    \LucaDegasperi\OAuth2Server\Middleware\OAuthExceptionHandlerMiddleware::class
]);

... and route middleware

$app->routeMiddleware([
    'check-authorization-params' => \LucaDegasperi\OAuth2Server\Middleware\CheckAuthCodeRequestMiddleware::class,
    'oauth' => \LucaDegasperi\OAuth2Server\Middleware\OAuthMiddleware::class,
    'oauth-client' => \LucaDegasperi\OAuth2Server\Middleware\OAuthClientOwnerMiddleware::class,
    'oauth-user' => \LucaDegasperi\OAuth2Server\Middleware\OAuthUserOwnerMiddleware::class,
]);

... and Authorizer alias

class_alias(\LucaDegasperi\OAuth2Server\Facades\Authorizer::class, 'Authorizer');

Copy config

Copy vendor/lucadegasperi/oauth2-server-laravel/config/oauth2.php to your own config folder (config/oauth2.php in your project root). It has to be the correct config folder as it is registered using $app->configure().

Migrate

First copy the migrations from vendor/lucadegasperi/oauth2-server-laravel/database/migrations to your applications database/migrations directory.

Uncomment $app->withEloquent(); and run php artisan migrate.

If you get an error saying the Config class can not be found, add class_alias('Illuminate\Support\Facades\Config', 'Config'); to your bootstrap/app.php file and uncomment $app->withFacades(); temporarily to import the migrations.


← Back to start

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui