diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml new file mode 100644 index 0000000..d9dcccd --- /dev/null +++ b/.github/workflows/pint.yml @@ -0,0 +1,30 @@ +name: Laravel Pint + +on: + pull_request: + push: + branches: [main] + +jobs: + pint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: composer:v2 + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Run Laravel Pint + run: vendor/bin/pint + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling diff --git a/composer.json b/composer.json index cc8dec5..e222e2a 100644 --- a/composer.json +++ b/composer.json @@ -25,5 +25,8 @@ "sort-packages": true }, "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "require-dev": { + "laravel/pint": "^1.16" + } } diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..02b0834 --- /dev/null +++ b/pint.json @@ -0,0 +1,3 @@ +{ + "preset": "laravel" +} diff --git a/src/App/Http/Controllers/BusyController.php b/src/App/Http/Controllers/BusyController.php index a1d1db2..3ecf149 100644 --- a/src/App/Http/Controllers/BusyController.php +++ b/src/App/Http/Controllers/BusyController.php @@ -7,7 +7,6 @@ use Illuminate\Http\Request; use Illuminate\Support\Str; - class BusyController extends Controller { public function storeBusy(Request $request) @@ -42,7 +41,7 @@ public function isBusy(Request $request) $resource = $this->getResource($request['model-id'], $request['model-name']); - if(! $resource) { + if (! $resource) { return response()->json([ 'success' => false, 'data' => null, diff --git a/src/NovaBusyResourceField.php b/src/NovaBusyResourceField.php index 2ea62ab..ed3ebb0 100644 --- a/src/NovaBusyResourceField.php +++ b/src/NovaBusyResourceField.php @@ -3,7 +3,6 @@ namespace The3labsTeam\NovaBusyResourceField; use Laravel\Nova\Fields\Field; -use Laravel\Nova\Http\Requests\NovaRequest; class NovaBusyResourceField extends Field { @@ -34,4 +33,4 @@ public function resolve($resource, $attribute = null) 'isBusyByCurrentUser' => $isBusyByCurrentUser, ]); } -} \ No newline at end of file +}