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
23 changes: 23 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
pull_request:
types: [ closed ]
branches:
- "main"

jobs:
release:
name: Create release
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
name: ${{ github.event.pull_request.title }}
tag: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
prerelease: false
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# uses the default GitHub actions app token
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

Expand Down
4 changes: 3 additions & 1 deletion src/Models/TenantScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class TenantScope implements Scope
public function apply(Builder $builder, Model $model)
{
$column = $model->qualifyColumn(config('tenantable.related_tenant_column'));
$tenantKey = tenant()->key();
$tenantKey = Tenant::check()
? tenant()->key()
: null;

if (config('tenantable.allow_nullable_tenant')) {
$builder->where(function (Builder $query) use ($column, $tenantKey) {
Expand Down