-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] Adds
fortify:install
Artisan command (#524)
* Adds `fortify:install` Artisan command * Apply fixes from StyleCI * Removes unused import * Fixes static analysis --------- Co-authored-by: StyleCI Bot <[email protected]>
- Loading branch information
1 parent
29cdcaf
commit b34e672
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Laravel\Fortify\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Support\ServiceProvider; | ||
use Laravel\Fortify\FortifyServiceProvider; | ||
|
||
class InstallCommand extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'fortify:install'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Install all of the Fortify resources'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
$this->callSilent('vendor:publish', [ | ||
'--provider' => FortifyServiceProvider::class, | ||
]); | ||
|
||
$this->registerFortifyServiceProvider(); | ||
|
||
$this->components->info('Fortify scaffolding installed successfully.'); | ||
} | ||
|
||
/** | ||
* Register the Fortify service provider in the application configuration file. | ||
*/ | ||
protected function registerFortifyServiceProvider(): void | ||
{ | ||
if (! method_exists(ServiceProvider::class, 'addProviderToBootstrapFile')) { | ||
return; | ||
} | ||
|
||
ServiceProvider::addProviderToBootstrapFile(\App\Providers\FortifyServiceProvider::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b34e672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi guys! First of all, thank you for the great work and can't wait to use Laravel 11!
I don't know if it's the right place to do it but, testing the Fortify installation in L11, running the command
php artisan fortify:install
returnsThere are no commands defined in the "fortify" namespace
.To make it work I had to run the classic
vendor:publish
command and then run in tinkerIlluminate\Support\ServiceProvider::addProviderToBootstrapFile(\App\Providers\FortifyServiceProvider::class);
.Thanks again!
b34e672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavideCariola thanks. We released a new version of Fortify for this.
b34e672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driesvints Thanks Dries: just ran
composer update laravel/fortify
and worked like a charm.My first test was half an hour ago via the
laravel new command
and thecomposer require laravel/fortify
found on the documentation FYI.