Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjude authored and github-actions[bot] committed Mar 2, 2024
1 parent 87c6122 commit 0f7c40a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
32 changes: 16 additions & 16 deletions src/Commands/FilamentJetstreamCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function handle(): int
{
$this->info('Filament Jetstream scaffolding...');

if (!$this->installFilamentPackage() || !$this->installJetstreamPackage()) {
if (! $this->installFilamentPackage() || ! $this->installJetstreamPackage()) {
return self::FAILURE;
}

Expand Down Expand Up @@ -57,7 +57,7 @@ public function handle(): int
*/
protected function installFilamentPackage(): bool
{
if (!$this->hasComposerPackage('filament/filament')) {
if (! $this->hasComposerPackage('filament/filament')) {
return $this->requireComposerPackages('filament/filament:^3.2');
}

Expand All @@ -69,7 +69,7 @@ protected function installFilamentPackage(): bool
*/
protected function installJetstreamPackage(): bool
{
if (!$this->hasComposerPackage('laravel/jetstream')) {
if (! $this->hasComposerPackage('laravel/jetstream')) {
return $this->requireComposerPackages('laravel/jetstream:^4.2');
}

Expand Down Expand Up @@ -187,15 +187,15 @@ protected function configurePanel()
$filesystem->ensureDirectoryExists(resource_path('views/filament/pages'));

collect($filesystem->files(app_path('Providers/Filament')))
->map(fn(\SplFileInfo $fileInfo) => str($fileInfo->getFilename())
->map(fn (\SplFileInfo $fileInfo) => str($fileInfo->getFilename())
->before('.php')->prepend("App\Providers\Filament")->append('::class,')->toString())
->each(fn($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php')));
->each(fn ($value) => $this->replaceInFile(search: $value, replace: '', path: config_path('app.php')));

$filesystem->copyDirectory(__DIR__.'/../../stubs/App', app_path('/'));
$filesystem->copyDirectory(__DIR__ . '/../../stubs/App', app_path('/'));

$filesystem->copyDirectory(__DIR__.'/../../stubs/resources/views/filament', resource_path('views/filament'));
$filesystem->copyDirectory(__DIR__ . '/../../stubs/resources/views/filament', resource_path('views/filament'));

copy(__DIR__.'/../../stubs/routes/web.php', base_path('routes/web.php'));
copy(__DIR__ . '/../../stubs/routes/web.php', base_path('routes/web.php'));

$this->installServiceProviderAfter('AuthServiceProvider', 'Filament\AppPanelProvider');
}
Expand Down Expand Up @@ -284,12 +284,12 @@ protected function runCommands(array $commands): void
try {
$process->setTty(true);
} catch (\RuntimeException $e) {
$this->output->writeln(' <bg=yellow;fg=black> WARN </> '.$e->getMessage().PHP_EOL);
$this->output->writeln(' <bg=yellow;fg=black> WARN </> ' . $e->getMessage() . PHP_EOL);
}
}

$process->run(function ($type, $line) {
$this->output->write(' '.$line);
$this->output->write(' ' . $line);
});
}

Expand All @@ -307,14 +307,14 @@ protected function hasComposerPackage(string $package): bool
/**
* Installs the given Composer Packages into the application.
*/
protected function requireComposerPackages(array|string $packages): bool
protected function requireComposerPackages(array | string $packages): bool
{
$command = array_merge(
['composer', 'require'],
is_array($packages) ? $packages : func_get_args()
);

return !(new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))
return ! (new Process($command, base_path(), ['COMPOSER_MEMORY_LIMIT' => '-1']))
->setTimeout(null)
->run(function ($type, $output) {
$this->output->write($output);
Expand All @@ -326,15 +326,15 @@ protected function requireComposerPackages(array|string $packages): bool
*/
protected function installServiceProviderAfter(string $after, string $name): void
{
if (!Str::contains(
if (! Str::contains(
$appConfig = file_get_contents(config_path('app.php')),
'App\\Providers\\'.$name.'::class'
'App\\Providers\\' . $name . '::class'
)) {
file_put_contents(
config_path('app.php'),
str_replace(
'App\\Providers\\'.$after.'::class,',
'App\\Providers\\'.$after.'::class,'.PHP_EOL.' App\\Providers\\'.$name.'::class,',
'App\\Providers\\' . $after . '::class,',
'App\\Providers\\' . $after . '::class,' . PHP_EOL . ' App\\Providers\\' . $name . '::class,',
$appConfig
)
);
Expand Down
1 change: 1 addition & 0 deletions stubs/App/Filament/Pages/ApiTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Filament\Pages;

use Filament\Pages\Page;

class ApiTokens extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-key';
Expand Down
1 change: 1 addition & 0 deletions stubs/App/Filament/Pages/CreateTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Filament\Forms\Form;
use Filament\Pages\Tenancy\RegisterTenant;
use Illuminate\Database\Eloquent\Model;

class CreateTeam extends RegisterTenant
{
public static function getLabel(): string
Expand Down
1 change: 1 addition & 0 deletions stubs/App/Filament/Pages/EditProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Filament\Pages;

use Filament\Pages\Page;

class EditProfile extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-user-circle';
Expand Down
1 change: 1 addition & 0 deletions stubs/App/Filament/Pages/EditTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Filament\Facades\Filament;
use Filament\Pages\Tenancy\EditTenantProfile;

class EditTeam extends EditTenantProfile
{
protected static string $view = 'filament.pages.edit-team';
Expand Down
6 changes: 3 additions & 3 deletions stubs/App/Providers/Filament/AppPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function panel(Panel $panel): Panel
MenuItem::make()
->label('Profile')
->icon('heroicon-o-user-circle')
->url(fn() => $this->shouldRegisterMenuItem()
->url(fn () => $this->shouldRegisterMenuItem()
? url(EditProfile::getUrl())
: url($panel->getPath())),
])
Expand Down Expand Up @@ -87,7 +87,7 @@ public function panel(Panel $panel): Panel
MenuItem::make()
->label('API Tokens')
->icon('heroicon-o-key')
->url(fn() => $this->shouldRegisterMenuItem()
->url(fn () => $this->shouldRegisterMenuItem()
? url(ApiTokens::getUrl())
: url($panel->getPath())),
]);
Expand All @@ -102,7 +102,7 @@ public function panel(Panel $panel): Panel
MenuItem::make()
->label('Team Settings')
->icon('heroicon-o-cog-6-tooth')
->url(fn() => $this->shouldRegisterMenuItem()
->url(fn () => $this->shouldRegisterMenuItem()
? url(EditTeam::getUrl())
: url($panel->getPath())),
]);
Expand Down
8 changes: 4 additions & 4 deletions stubs/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
|
*/

Route::get('/', fn() => view('welcome'));
Route::get('/', fn () => view('welcome'));

Route::redirect('/login', "/app/login")->name('login');
Route::redirect('/login', '/app/login')->name('login');

Route::redirect('/register', "/app/register")->name('register');
Route::redirect('/register', '/app/register')->name('register');

Route::redirect('/dashboard', "/app")->name('dashboard');
Route::redirect('/dashboard', '/app')->name('dashboard');

Route::get('/team-invitations/{invitation}', [TeamInvitationController::class, 'accept'])
->middleware(['signed', 'verified', 'auth:filament', AuthenticateSession::class])
Expand Down

0 comments on commit 0f7c40a

Please sign in to comment.