Skip to content

Commit

Permalink
Resolving wrong app instance on Octane (#285)
Browse files Browse the repository at this point in the history
* Update SanctumServiceProvider.php

* fixed sevice provider
  • Loading branch information
RahulDey12 committed Jun 13, 2021
1 parent f8e8ccd commit ee48210
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SanctumServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function register()
], config('auth.guards.sanctum', [])),
]);

if (! $this->app->configurationIsCached()) {
if (! app()->configurationIsCached()) {
$this->mergeConfigFrom(__DIR__.'/../config/sanctum.php', 'sanctum');
}
}
Expand All @@ -38,7 +38,7 @@ public function register()
*/
public function boot()
{
if ($this->app->runningInConsole()) {
if (app()->runningInConsole()) {
$this->registerMigrations();

$this->publishes([
Expand Down Expand Up @@ -74,7 +74,7 @@ protected function registerMigrations()
*/
protected function defineRoutes()
{
if ($this->app->routesAreCached() || config('sanctum.routes') === false) {
if (app()->routesAreCached() || config('sanctum.routes') === false) {
return;
}

Expand Down Expand Up @@ -113,7 +113,7 @@ protected function createGuard($auth, $config)
{
return new RequestGuard(
new Guard($auth, config('sanctum.expiration'), $config['provider']),
$this->app['request'],
app()['request'],
$auth->createUserProvider($config['provider'] ?? null)
);
}
Expand All @@ -125,7 +125,7 @@ protected function createGuard($auth, $config)
*/
protected function configureMiddleware()
{
$kernel = $this->app->make(Kernel::class);
$kernel = app()->make(Kernel::class);

$kernel->prependToMiddlewarePriority(EnsureFrontendRequestsAreStateful::class);
}
Expand Down

0 comments on commit ee48210

Please sign in to comment.