Skip to content

Commit

Permalink
Warn when laravel/ui is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Apr 21, 2020
1 parent 7143690 commit 37f3322
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Facades/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Illuminate\Support\Facades;

use Laravel\Ui\UiServiceProvider;
use LogicException;

/**
* @method static mixed guard(string|null $name = null)
* @method static void shouldUse(string $name);
Expand Down Expand Up @@ -49,6 +52,10 @@ protected static function getFacadeAccessor()
*/
public static function routes(array $options = [])
{
if (! array_key_exists(UiServiceProvider::class, static::$app->getLoadedProviders())) {
throw new LogicException('Please install the laravel/ui package in order to use the Route::auth() method.');
}

static::$app->make('router')->auth($options);
}
}

0 comments on commit 37f3322

Please sign in to comment.