Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
31 changes: 31 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
* text=auto eol=lf

# Files & directories excluded from the distributed Composer package.
# The compiled tool assets in /dist ship; the JS/TS sources and build config do not.
/.github export-ignore
/art export-ignore
/tests export-ignore
/workbench export-ignore
/resources/js export-ignore
/resources/css export-ignore
/.editorconfig export-ignore
/.eslintrc export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.nvmrc export-ignore
/.prettierrc export-ignore
/generators.js export-ignore
/package.json export-ignore
/postcss.config.cjs export-ignore
/tailwind.config.cjs export-ignore
/tsconfig.json export-ignore
/tsconfig.node.json export-ignore
/vite.config.ts export-ignore
/phpunit.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/pint.json export-ignore
/testbench.yaml export-ignore
/CONTRIBUTING.md export-ignore
/CHANGELOG.md export-ignore
/SECURITY.md export-ignore
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🐛 Bug Report
description: Report a reproducible bug in nova-permission.
labels: ['bug']
body:
- type: textarea
id: what-happened
attributes:
label: What happened?
description: A clear description of the bug and what you expected instead.
validations:
required: true

- type: textarea
id: reproduce
attributes:
label: How to reproduce
description: Minimal steps that trigger the issue (model + trait setup, relevant config, and the request or action).
validations:
required: true

- type: input
id: package-version
attributes:
label: Package version
validations:
required: true

- type: input
id: php-version
attributes:
label: PHP version
validations:
required: true

- type: input
id: nova-version
attributes:
label: Laravel & Nova versions
validations:
required: true

- type: textarea
id: notes
attributes:
label: Additional notes
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Ask a question
url: https://github.com/BBS-Lab/nova-permission/discussions
about: Ask and answer questions about this package.
- name: 🔒 Report a security issue
url: https://github.com/BBS-Lab/nova-permission/security/policy
about: Please report security vulnerabilities privately.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: composer
directory: /
schedule:
interval: weekly
labels:
- dependencies

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- dependencies

- package-ecosystem: npm
directory: /
schedule:
interval: weekly
labels:
- dependencies
26 changes: 26 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: code-style

on:
push:
branches: [master]
paths: ['**.php', 'pint.json']
pull_request:
branches: [master]
paths: ['**.php', 'pint.json']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Check code style with Pint
uses: aglipanci/laravel-pint-action@2.6
with:
args: '--test'
32 changes: 32 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: phpstan

on:
push:
branches: [master]
paths: ['**.php', 'phpstan.neon.dist', 'phpstan-baseline.neon']
pull_request:
branches: [master]
paths: ['**.php', 'phpstan.neon.dist', 'phpstan-baseline.neon']

jobs:
phpstan:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none

- name: Authenticate Nova
run: composer config http-basic.nova.laravel.com "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"

- name: Install Composer dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Run PHPStan
run: composer analyse -- --error-format=github
32 changes: 32 additions & 0 deletions .github/workflows/run-mutation-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: mutation

on:
push:
branches: [master]
paths: ['src/**', 'tests/**', 'composer.json']
pull_request:
branches: [master]
paths: ['src/**', 'tests/**', 'composer.json']

jobs:
mutation:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: pcov

- name: Authenticate Nova
run: composer config http-basic.nova.laravel.com "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"

- name: Install Composer dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Run mutation tests
run: composer test-mutation
59 changes: 59 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: tests

on:
push:
branches: [master]
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
# Primary target: latest everything, enforces 100% coverage.
- { name: 'Nova 5 / Laravel 13 / PHP 8.4', php: '8.4', nova: '^5.0', extra: '', coverage: true }
# Nova 5 on the newest PHP.
- { name: 'Nova 5 / Laravel 13 / PHP 8.5', php: '8.5', nova: '^5.0', extra: '', coverage: false }
# Nova 5 on the lowest PHP that Laravel 13 supports.
- { name: 'Nova 5 / Laravel 13 / PHP 8.3', php: '8.3', nova: '^5.0', extra: '', coverage: false }
# Nova 5 on Laravel 12.
- { name: 'Nova 5 / Laravel 12 / PHP 8.4', php: '8.4', nova: '^5.0', extra: '--with=laravel/framework:^12.0 --with=orchestra/testbench:^10.0', coverage: false }
# Nova 5 on the lowest supported Laravel + PHP floor. Runtime floor is
# PHP 8.2, but Pest 4 (dev) requires 8.3, so 8.3 is the lowest CI can run.
- { name: 'Nova 5 / Laravel 11 / PHP 8.3', php: '8.3', nova: '^5.0', extra: '--with=laravel/framework:^11.0 --with=orchestra/testbench:^9.0', coverage: false }
# Nova 4 caps at Laravel 11 (its inertia-laravel dep blocks Laravel 12+)
# and PHP 8.4. Do NOT pin the framework version — let Composer resolve
# the Laravel/inertia combination Nova 4 is compatible with; pinning
# ^11.0 drags in an incompatible inertia-laravel and fails to resolve.
- { name: 'Nova 4 / Laravel 11 / PHP 8.4', php: '8.4', nova: '^4.0', extra: '--with=orchestra/testbench:^9.0 --with-all-dependencies', coverage: false }
- { name: 'Nova 4 / Laravel 11 / PHP 8.3', php: '8.3', nova: '^4.0', extra: '--with=orchestra/testbench:^9.0 --with-all-dependencies', coverage: false }

name: ${{ matrix.name }}

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, fileinfo
coverage: pcov

- name: Authenticate Nova
run: composer config http-basic.nova.laravel.com "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"

- name: Install Composer dependencies
run: composer update --with="laravel/nova:${{ matrix.nova }}" ${{ matrix.extra }} --prefer-dist --no-interaction --no-progress

- name: Run tests
run: ${{ matrix.coverage && 'composer test-coverage' || 'vendor/bin/pest --no-coverage' }}
31 changes: 31 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: update-changelog

on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: master

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name || github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated changelog
uses: stefanzweifel/git-auto-commit-action@v7
with:
branch: master
commit_message: 'docs: update CHANGELOG'
file_pattern: CHANGELOG.md
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/.idea
/vendor
/node_modules
/build
package-lock.json
yarn.lock
composer.phar
composer.lock
auth.json
phpunit.xml
.phpunit.result.cache
.phpunit.cache
.DS_Store
Thumbs.db
yarn.lock
/build
database/migrations/*.php
auth.json
21 changes: 0 additions & 21 deletions .scrutinizer.yml

This file was deleted.

1 change: 0 additions & 1 deletion .styleci.yml

This file was deleted.

Loading
Loading