Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cesargb/laravel-cascade-delete
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: cesargb/laravel-cascade-delete
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 20, 2021

  1. Update tests.yml

    cesargb authored Mar 20, 2021
    Copy the full SHA
    be14c68 View commit details

Commits on Oct 14, 2021

  1. Delete .travis.yml

    cesargb authored Oct 14, 2021
    Copy the full SHA
    301be5e View commit details
  2. remove support L7

    cesargb authored Oct 14, 2021
    Copy the full SHA
    5c16cf1 View commit details
  3. remove support L7

    cesargb authored Oct 14, 2021
    Copy the full SHA
    6c8418f View commit details
  4. Apply fixes from StyleCI

    cesargb authored and StyleCIBot committed Oct 14, 2021
    Copy the full SHA
    a16e20d View commit details
  5. Merge pull request #11 from cesargb/analysis-Vrmjx6

    Apply fixes from StyleCI
    cesargb authored Oct 14, 2021
    Copy the full SHA
    00ffb0b View commit details

Commits on Oct 19, 2021

  1. add test to php8.1

    cesargb committed Oct 19, 2021
    Copy the full SHA
    f4baf63 View commit details

Commits on Oct 30, 2021

  1. test: exclude php81 and L6

    cesargb committed Oct 30, 2021
    Copy the full SHA
    972e261 View commit details
  2. Copy the full SHA
    b5af16b View commit details
  3. Copy the full SHA
    03dec14 View commit details
  4. Merge pull request #12 from cesargb/php81

    add test to php8.1
    cesargb authored Oct 30, 2021
    Copy the full SHA
    b8cdaed View commit details

Commits on Jan 16, 2022

  1. fix: md

    cesargb committed Jan 16, 2022
    Copy the full SHA
    cc0d840 View commit details
  2. add support to L9

    cesargb committed Jan 16, 2022
    Copy the full SHA
    2a61020 View commit details
  3. Merge pull request #13 from cesargb/l9

    add support to L9
    cesargb authored Jan 16, 2022
    Copy the full SHA
    d444eed View commit details
  4. clean

    cesargb committed Jan 16, 2022
    Copy the full SHA
    c692f42 View commit details

Commits on May 30, 2022

  1. Update tests.yml

    cesargb authored May 30, 2022
    Copy the full SHA
    5c7140c View commit details

Commits on Sep 4, 2022

  1. Take morph map into account (#15)

    Translate FQCN into class alias from morph map
    buddhaCode authored Sep 4, 2022
    Copy the full SHA
    6883030 View commit details

Commits on Nov 25, 2022

  1. phpunit migrate xml

    cesargb committed Nov 25, 2022
    Copy the full SHA
    346b8cf View commit details
  2. Copy the full SHA
    117dc33 View commit details
  3. add tests to php82 (#18)

    cesargb authored Nov 25, 2022
    Copy the full SHA
    88a8bab View commit details

Commits on Jan 6, 2023

  1. Create dependabot.yml

    cesargb authored Jan 6, 2023
    Copy the full SHA
    0ec733d View commit details
  2. Bump actions/checkout from 2 to 3 (#19)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v2...v3)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 6, 2023
    Copy the full SHA
    218fbbc View commit details
  3. Update actions (#20)

    * remove styleci
    
    * add phpcs action
    
    * add phpstan action
    
    * fix phpstan
    
    * remove support to php74
    
    * remove support to Laravel 8
    cesargb authored Jan 6, 2023
    Copy the full SHA
    8689ab0 View commit details
  4. Copy the full SHA
    9f87fd4 View commit details
  5. update badges

    cesargb committed Jan 6, 2023
    Copy the full SHA
    7f01df2 View commit details

Commits on Jan 17, 2023

  1. Copy the full SHA
    a0371c1 View commit details

Commits on Jan 18, 2023

  1. Clarify deleted records in README (#22)

    The Morph To Many relation uses a pivot table. Thus, not the Tag record will be deleted, but the pivot record in the ```taggables``` table.
    buddhaCode authored Jan 18, 2023
    Copy the full SHA
    5640113 View commit details

Commits on Jan 31, 2023

  1. Copy the full SHA
    aa4aae8 View commit details

Commits on Nov 27, 2023

  1. Refactor whereRaw to use whereColumn (#25)

    Addresses the issue with json field relationship. E.g
    {
    "object_type": "comment",
    "object_id": "1"
    } 
    
    $this->morphOne(Notification::class, 'data->object';)
    sadiqsalau authored Nov 27, 2023
    Copy the full SHA
    f266e8c View commit details
  2. Bump actions/checkout from 3 to 4 (#24)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 27, 2023
    Copy the full SHA
    d176a6e View commit details
  3. Add test to php83 (#26)

    cesargb authored Nov 27, 2023
    Copy the full SHA
    17e0406 View commit details

Commits on Feb 2, 2024

  1. Bump actions/cache from 3 to 4 (#27)

    Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
    - [Release notes](https://github.com/actions/cache/releases)
    - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
    - [Commits](actions/cache@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/cache
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 2, 2024
    Copy the full SHA
    9b317b0 View commit details

Commits on Mar 9, 2024

  1. Laravel 11.x Compatibility (#28)

    * Bump dependencies for Laravel 11
    
    * Update GitHub Actions for Laravel 11
    
    ---------
    
    Co-authored-by: Cesar <cesargb@gmail.com>
    laravel-shift and cesargb authored Mar 9, 2024
    Copy the full SHA
    26299d9 View commit details
  2. migrate to larastan (#29)

    cesargb authored Mar 9, 2024
    Copy the full SHA
    ae3ab05 View commit details
  3. Remove support to Laravel 9 (#30)

    * Remove support to Laravel 9
    
    * Remove support to Laravel 9
    cesargb authored Mar 9, 2024
    Copy the full SHA
    bcdbbec View commit details

Commits on Dec 3, 2024

  1. Add test to php 8.4

    cesargb authored Dec 3, 2024
    Copy the full SHA
    e7e847a View commit details

Commits on Feb 24, 2025

  1. Laravel 12.x Compatibility (#31)

    * Bump dependencies for Laravel 12
    
    * Update GitHub Actions for Laravel 12
    laravel-shift authored Feb 24, 2025
    Copy the full SHA
    1c265a7 View commit details
  2. fix phpstan

    cesargb committed Feb 24, 2025
    Copy the full SHA
    0606f81 View commit details
  3. update .gitignore

    cesargb committed Feb 24, 2025
    Copy the full SHA
    1209375 View commit details
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.github export-ignore
/tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
.php-cs-fixer.dist.php export-ignore
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: phpstan

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

jobs:
phpstan:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.2-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.2-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install
composer dump
- name: Run analyse phpstan
run: vendor/bin/phpstan analyse --error-format github
41 changes: 41 additions & 0 deletions .github/workflows/style-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: style-fix

on:
push:
branches: [master]

jobs:
style:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.2-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php--8.2
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer install
composer dump
- name: Fix styles
run: vendor/bin/php-cs-fixer fix
- uses: EndBug/add-and-commit@v9

- name: Run style
run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit
86 changes: 44 additions & 42 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
- push
- pull_request

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0]
laravel: [8.*, 7.*, 6.*]
dependency-version: [prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Update apt
run: sudo apt-get update --fix-missing

- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
run-tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.4, 8.3, 8.2]
laravel: ['10.*', '11.*', '12.*']
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*
exclude:
- laravel: 10.*
php: 8.4

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, sqlite, pdo_sqlite
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
env:
XDEBUG_MODE: coverage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,5 @@
/build
composer.lock
.phpunit.result.cache
.php-cs-fixer.cache
.phpunit.cache
41 changes: 41 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
])
->setFinder($finder);
30 changes: 0 additions & 30 deletions .php_cs

This file was deleted.

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

This file was deleted.

50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
![tests](https://github.com/cesargb/laravel-cascade-delete/workflows/tests/badge.svg)
[![StyleCI](https://github.styleci.io/repos/144183283/shield?branch=master)](https://github.styleci.io/repos/144183283)
[![tests](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/tests.yml/badge.svg)](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/tests.yml)
[![phpstan](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/phpstan.yml/badge.svg)](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/phpstan.yml)
[![style-fix](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/style-fix.yml/badge.svg)](https://github.com/cesargb/laravel-cascade-delete/actions/workflows/style-fix.yml)
[![Quality Score](https://img.shields.io/scrutinizer/g/cesargb/laravel-cascade-delete.svg?style=flat-square)](https://scrutinizer-ci.com/g/cesargb/laravel-cascade-delete)
[![Total Downloads](https://img.shields.io/packagist/dt/cesargb/laravel-cascade-delete.svg?style=flat-square)](https://packagist.org/packages/cesargb/laravel-cascade-delete)

@@ -58,8 +59,8 @@ class Video extends Model
}
```

Now you can delete an `App\Video` record, and any associated `App\Image`, `App\Tag` and
`App\Options` records will be deleted.
Now you can delete an `App\Video` record, and any associated `App\Image`, `App\Options` and pivot records for
`App\Tag` will be deleted.

## Delete Residuals

@@ -77,6 +78,7 @@ $video = new Video;

$video->deleteMorphResidual();
```

### Command to remove all residuals

You can use Artisan command `morph:clean` to remove all residuals data from all
Loading