• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

luttje / filament-user-attributes / 6909724102

17 Nov 2023 10:28PM UTC coverage: 59.278% (+7.6%) from 51.704%
6909724102

push

github

luttje
fix basename not working for linux

1 of 2 new or added lines in 2 files covered. (50.0%)

103 existing lines in 8 files now uncovered.

837 of 1412 relevant lines covered (59.28%)

16.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.56
/src/FilamentUserAttributesServiceProvider.php
1
<?php
2

3
namespace Luttje\FilamentUserAttributes;
4

5
use Filament\Support\Assets\Asset;
6
use Filament\Support\Facades\FilamentAsset;
7
use Luttje\FilamentUserAttributes\Commands\WizardCommand;
8
use Spatie\LaravelPackageTools\Commands\InstallCommand;
9
use Spatie\LaravelPackageTools\Package;
10
use Spatie\LaravelPackageTools\PackageServiceProvider;
11

12
class FilamentUserAttributesServiceProvider extends PackageServiceProvider
13
{
14
    public static string $name = 'filament-user-attributes';
15

16
    public static string $viewNamespace = 'filament-user-attributes';
17

18
    public function configurePackage(Package $package): void
188✔
19
    {
20
        $package->name(static::$name)
188✔
21
            ->hasCommand(WizardCommand::class)
188✔
22
            ->hasInstallCommand(function (InstallCommand $command) {
188✔
23
                $command
188✔
24
                    ->publishConfigFile()
188✔
25
                    ->publishMigrations()
188✔
26
                    ->askToRunMigrations()
188✔
27
                    ->askToStarRepoOnGitHub('luttje/filament-user-attributes');
188✔
28
            });
188✔
29

30
        if (file_exists($package->basePath("/../config/filament-user-attributes.php"))) {
188✔
31
            $package->hasConfigFile('filament-user-attributes');
188✔
32
        }
33

34
        if (file_exists($package->basePath('/../database/migrations'))) {
188✔
35
            $package->hasMigrations($this->getMigrations());
188✔
36
        }
37

38
        if (file_exists($package->basePath('/../resources/lang'))) {
188✔
39
            $package->hasTranslations();
188✔
40
        }
41

42
        if (file_exists($package->basePath('/../resources/views'))) {
188✔
43
            $package->hasViews(static::$viewNamespace);
188✔
44
        }
45
    }
46

47
    public function packageRegistered(): void
188✔
48
    {
49
        $this->app->singleton('filamentUserAttributes', function ($app) {
188✔
50
            return new FilamentUserAttributes();
188✔
51
        });
188✔
52
    }
53

54
    public function packageBooted(): void
188✔
55
    {
56
        \Luttje\FilamentUserAttributes\Facades\FilamentUserAttributes::registerDefaultUserAttributeComponentFactories();
188✔
57

58
        FilamentAsset::register(
188✔
59
            $this->getAssets(),
188✔
60
            $this->getAssetPackageName()
188✔
61
        );
188✔
62

63
        FilamentAsset::registerScriptData(
188✔
64
            $this->getScriptData(),
188✔
65
            $this->getAssetPackageName()
188✔
66
        );
188✔
67
    }
68

69
    protected function getAssetPackageName(): ?string
188✔
70
    {
71
        return 'luttje/filament-user-attributes';
188✔
72
    }
73

74
    /**
75
     * @return array<Asset>
76
     */
77
    protected function getAssets(): array
188✔
78
    {
79
        return [];
188✔
80
    }
81

82
    /**
83
     * @return array<string>
84
     */
85
    protected function getRoutes(): array
×
86
    {
UNCOV
87
        return [];
×
88
    }
89

90
    /**
91
     * @return array<string, mixed>
92
     */
93
    protected function getScriptData(): array
188✔
94
    {
95
        return [];
188✔
96
    }
97

98
    /**
99
     * @return array<string>
100
     */
101
    protected function getMigrations(): array
188✔
102
    {
103
        return [
188✔
104
            'create_user_attributes_table',
188✔
105
            'create_user_attribute_configs_table',
188✔
106
        ];
188✔
107
    }
108
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc