Some checks failed
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.1, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, ubuntu-latest, 8.2, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.1, prefer-stable, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-lowest, 8.*) (push) Waiting to run
run-tests / P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} (2.*, 10.*, windows-latest, 8.2, prefer-stable, 8.*) (push) Waiting to run
Fix PHP Code Styling / php-code-styling (push) Has been cancelled
PHPStan / phpstan (push) Has been cancelled
77 lines
2.0 KiB
PHP
77 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace AlexanderGabriel\FilamentOauth2;
|
|
|
|
use Illuminate\Filesystem\Filesystem;
|
|
use Livewire\Features\SupportTesting\Testable;
|
|
use Spatie\LaravelPackageTools\Commands\InstallCommand;
|
|
use Spatie\LaravelPackageTools\Package;
|
|
use Spatie\LaravelPackageTools\PackageServiceProvider;
|
|
use AlexanderGabriel\FilamentOauth2\Commands\FilamentOauth2Command;
|
|
use AlexanderGabriel\FilamentOauth2\Testing\TestsFilamentOauth2;
|
|
|
|
class FilamentOauth2ServiceProvider extends PackageServiceProvider
|
|
{
|
|
public static string $name = 'filament-oauth2';
|
|
|
|
public static string $viewNamespace = 'filament-oauth2';
|
|
|
|
public function configurePackage(Package $package): void
|
|
{
|
|
/*
|
|
* This class is a Package Service Provider
|
|
*
|
|
* More info: https://github.com/spatie/laravel-package-tools
|
|
*/
|
|
$package->name(static::$name)
|
|
->hasCommands($this->getCommands())
|
|
->hasInstallCommand(function (InstallCommand $command) {
|
|
$command
|
|
->publishConfigFile()
|
|
->askToStarRepoOnGitHub('alexandergabriel/filament-oauth2');
|
|
})
|
|
->hasRoutes('web');
|
|
|
|
$configFileName = $package->shortName();
|
|
|
|
if (file_exists($package->basePath("/../config/{$configFileName}.php"))) {
|
|
$package->hasConfigFile();
|
|
}
|
|
|
|
if (file_exists($package->basePath('/../resources/lang'))) {
|
|
$package->hasTranslations();
|
|
}
|
|
|
|
if (file_exists($package->basePath('/../resources/views'))) {
|
|
$package->hasViews(static::$viewNamespace);
|
|
}
|
|
}
|
|
|
|
public function packageRegistered(): void {}
|
|
|
|
public function packageBooted(): void
|
|
{
|
|
// Testing
|
|
Testable::mixin(new TestsFilamentOauth2);
|
|
}
|
|
|
|
/**
|
|
* @return array<class-string>
|
|
*/
|
|
protected function getCommands(): array
|
|
{
|
|
return [
|
|
FilamentOauth2Command::class,
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array<string>
|
|
*/
|
|
protected function getRoutes(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
}
|