Skip to content
New issue

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

Resolving wrong app instance on Octane #285

Merged
merged 2 commits into from
Jun 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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