Skip to content

Commit 4d084c3

Browse files
committed
Correctly call the tailwindcss preset if the auth flag is not passed
Due to the removal of `tailwindcss-auth` macro the `tailwindcss` macro will always run `TailwindCssPreset::installAuth()`. This is in large part because how macro's work and the `UiCommand::macro('tailwindcss')` getting overwritten by `AuthCommand::macro('tailwindcss')`. This commit assumes that just having one macro of `tailwindcss` is the acceptable use moving forward. With that said, this commit check the command option auth flag and if it's true will correctly install all the auth presets. This commit also removes the call to the `install()` method on the TailwindCssPreset::installAuth method as this should always be called on the macro.
1 parent 64e82b0 commit 4d084c3

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/TailwindCssPreset.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static function install()
2323

2424
public static function installAuth()
2525
{
26-
static::install();
2726
static::scaffoldController();
2827
static::scaffoldAuth();
2928
}

src/TailwindCssPresetServiceProvider.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ public function boot()
1414
UiCommand::macro('tailwindcss', function ($command) {
1515
TailwindCssPreset::install();
1616

17-
$command->info('Tailwind CSS scaffolding installed successfully.');
18-
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
19-
});
17+
if ( $command->option('auth') ) {
18+
TailwindCssPreset::installAuth();
19+
}
2020

21-
AuthCommand::macro('tailwindcss', function ($command) {
22-
TailwindCssPreset::installAuth();
23-
24-
$command->info('Tailwind CSS scaffolding with auth views installed successfully.');
21+
$command->info('Tailwind CSS scaffolding installed successfully.');
2522
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
2623
});
2724

0 commit comments

Comments
 (0)