diff --git a/.DS_Store b/.DS_Store index 5c19e84..a29c0ed 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 41099d3..7886fe6 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -10,20 +10,19 @@ jobs: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v1.3.4 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - + - name: Auto-merge Dependabot PRs for semver-minor updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - + - name: Auto-merge Dependabot PRs for semver-patch updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} run: gh pr merge --auto --merge "$PR_URL" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263..2669c70 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -3,8 +3,8 @@ name: PHPStan on: push: paths: - - '**.php' - - 'phpstan.neon.dist' + - "**.php" + - "phpstan.neon.dist" jobs: phpstan: @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: "8.1" coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9ad4b1a..67a00eb 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,14 +9,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php: [8.2, 8.1, 8.0] - laravel: [9.*] - dependency-version: [prefer-stable] + php: [8.0, 8.1] + laravel: [8.*, 9.*] + stability: [prefer-stable] include: + - laravel: 8.* + testbench: ^6.25 - laravel: 9.* testbench: 7.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code @@ -29,15 +31,15 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none - - name: Setup problem matches + - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List installed dependencies run: composer show -D diff --git a/README.md b/README.md index 7888b26..62395c4 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,6 @@ You can publish the config file with: php artisan vendor:publish --tag="setting-config" ``` -You can publish all files and run the migrations with: - -```bash -php artisan setting:install -``` - This is the contents of the published config file: ```php @@ -65,7 +59,7 @@ return [ 'drivers' => [ 'database' => [ - 'driver' => MichaelNabil230\Setting\Stores\DatabaseSettingStore::class, + 'driver' => \MichaelNabil230\Setting\Stores\DatabaseSettingStore::class, 'options' => [ 'model' => Setting::class, 'table' => 'settings', // name of table in dataBase @@ -85,7 +79,7 @@ return [ ], 'json' => [ - 'driver' => MichaelNabil230\Setting\Stores\JsonSettingStore::class, + 'driver' => \MichaelNabil230\Setting\Stores\JsonSettingStore::class, 'options' => [ 'path' => storage_path('settings.json'), ] @@ -274,7 +268,7 @@ return [ 'drivers' => [ 'database' => [ - 'driver' => MichaelNabil230\Setting\Stores\DatabaseSettingStore::class, + 'driver' => \MichaelNabil230\Setting\Stores\DatabaseSettingStore::class, 'options' => [ 'model' => Setting::class, 'table' => 'settings', // name of table in dataBase @@ -294,7 +288,7 @@ return [ ], 'json' => [ - 'driver' => MichaelNabil230\Setting\Stores\JsonSettingStore::class, + 'driver' => \MichaelNabil230\Setting\Stores\JsonSettingStore::class, 'options' => [ 'path' => storage_path('settings.json'), ] diff --git a/composer.json b/composer.json index 17093d4..2a6bbb3 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ ], "require": { "php": "^8.0", - "spatie/laravel-package-tools": "^1.13.6", - "illuminate/contracts": "^8.73|^9.0" + "illuminate/contracts": "^8.73|^9.0", + "spatie/laravel-package-tools": "1.11.0" }, "require-dev": { "laravel/pint": "^1.0", diff --git a/src/SettingServiceProvider.php b/src/SettingServiceProvider.php index 55be26d..0069c22 100644 --- a/src/SettingServiceProvider.php +++ b/src/SettingServiceProvider.php @@ -8,7 +8,6 @@ use MichaelNabil230\Setting\Commands\GetSetting; use MichaelNabil230\Setting\Commands\SetOrUpdateSetting; use MichaelNabil230\Setting\Stores\SettingStore; -use Spatie\LaravelPackageTools\Commands\InstallCommand; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -20,13 +19,6 @@ public function configurePackage(Package $package): void ->name('setting') ->hasConfigFile() ->hasMigration('create_settings_table') - ->hasInstallCommand(function (InstallCommand $command) { - $command - ->publishConfigFile() - ->publishMigrations() - ->askToRunMigrations() - ->askToStarRepoOnGitHub('michaelnabil230/laravel-setting'); - }) ->hasCommands([ GetSetting::class, ForgetSetting::class,