Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Laravel Pint and GitHub workflow #10

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -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 --test

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"require-dev": {
"laravel/pint": "^1.16"
}
}
3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "laravel"
}
3 changes: 1 addition & 2 deletions src/App/Http/Controllers/BusyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Http\Request;
use Illuminate\Support\Str;


class BusyController extends Controller
{
public function storeBusy(Request $request)
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/NovaBusyResourceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace The3labsTeam\NovaBusyResourceField;

use Laravel\Nova\Fields\Field;
use Laravel\Nova\Http\Requests\NovaRequest;

class NovaBusyResourceField extends Field
{
Expand Down Expand Up @@ -34,4 +33,4 @@ public function resolve($resource, $attribute = null)
'isBusyByCurrentUser' => $isBusyByCurrentUser,
]);
}
}
}
Loading