Skip to content

Commit

Permalink
fix: fix configs and add command for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
NursultanIITU committed Sep 11, 2023
1 parent 1c2c35f commit ec2baef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
5 changes: 5 additions & 0 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public function handle()
'FILAMENT_IMPERSONATE_REDIRECT',
], config('admin-kit.panel.path'));

// load asset files
if ($this->confirm('Load asset files?', true)) {
$this->call('filament:assets');
}

// completing the installation
$this->info('Admin Kit has been successfully installed =)');
$this->info('To create a SuperAdmin user, run: <comment>php artisan shield:super-admin</comment>');
Expand Down
8 changes: 4 additions & 4 deletions src/CoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function configurePackage(Package $package): void
*/
$package
->name('admin-kit')
->hasConfigFile()
->hasMigration('create_admin_kit_users_table')
->hasTranslations()
->hasRoute('api')
Expand All @@ -30,10 +29,10 @@ public function configurePackage(Package $package): void

public function registeringPackage()
{
$this->registerConfigs();

$this->app->register(AdminPanelProvider::class);
$this->app->register(MiddlewareServiceProvider::class);

$this->registerAuthConfigs();
}

public function bootingPackage(): void
Expand All @@ -42,8 +41,9 @@ public function bootingPackage(): void
$this->configureTimezoneForFilament();
}

protected function registerAuthConfigs(): self
protected function registerConfigs(): self
{
$this->mergeConfigFrom(__DIR__.'/../config/admin-kit.php', 'admin-kit');
$this->mergeConfigFrom(__DIR__.'/../config/auth_guards.php', 'auth.guards');
$this->mergeConfigFrom(__DIR__.'/../config/auth_providers.php', 'auth.providers');

Expand Down
17 changes: 0 additions & 17 deletions src/Providers/FilamentServiceProvider.php

This file was deleted.

2 changes: 1 addition & 1 deletion stubs/app/AdminKitUser.stub
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class AdminKitUser extends Authenticatable implements FilamentUser

public function canAccessPanel(Panel $panel): bool
{
return str_ends_with($this->email, '@ibecsystems.com') && $this->hasVerifiedEmail();
return true;
}
}

0 comments on commit ec2baef

Please sign in to comment.