diff --git a/README.md b/README.md index 3a8ed5f..1467c9b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Cascading soft deletes for the Laravel PHP Framework [![Build Status](https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/workflows/run-tests/badge.svg)](https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/actions?query=workflow%3Arun-tests) -[![Latest Stable Version](https://poser.pugx.org/iatstuti/laravel-cascade-soft-deletes/v/stable)](https://packagist.org/packages/dyrynda/laravel-cascade-soft-deletes) +[![Latest Stable Version](https://poser.pugx.org/dyrynda/laravel-cascade-soft-deletes/v/stable)](https://packagist.org/packages/dyrynda/laravel-cascade-soft-deletes) [![Total Downloads](https://poser.pugx.org/dyrynda/laravel-cascade-soft-deletes/downloads)](https://packagist.org/packages/dyrynda/laravel-cascade-soft-deletes) [![License](https://poser.pugx.org/dyrynda/laravel-cascade-soft-deletes/license)](https://packagist.org/packages/dyrynda/laravel-cascade-soft-deletes) [![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/michaeldyrynda/laravel-cascade-soft-deletes) @@ -24,7 +24,7 @@ In doing so, however, you lose the ability to use the cascading delete functiona namespace App; use App\Comment; -use Iatstuti\Database\Support\CascadeSoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -68,7 +68,7 @@ As of right now this is not documented in the Larvel docs, but just know that th This trait is installed via [Composer](http://getcomposer.org/). To install, simply add to your `composer.json` file: ``` -$ composer require iatstuti/laravel-cascade-soft-deletes +$ composer require dyrynda/laravel-cascade-soft-deletes ``` ## Support diff --git a/composer.json b/composer.json index 80914b0..f9d84ca 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ }, "autoload": { "psr-4": { - "Iatstuti\\Database\\Support\\": "src/" + "Dyrynda\\Database\\Support\\": "src/" } }, "autoload-dev": { diff --git a/src/CascadeSoftDeleteException.php b/src/CascadeSoftDeleteException.php index 53fbc12..32c5f79 100644 --- a/src/CascadeSoftDeleteException.php +++ b/src/CascadeSoftDeleteException.php @@ -1,6 +1,6 @@ schema()->create('authors__post_types', function ($table) { - $table->increments('id'); $table->integer('author_id'); $table->integer('posttype_id'); diff --git a/tests/Entities/Author.php b/tests/Entities/Author.php index 60811f3..8fe0fb7 100644 --- a/tests/Entities/Author.php +++ b/tests/Entities/Author.php @@ -2,9 +2,9 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; class Author extends Model { diff --git a/tests/Entities/InvalidRelationshipPost.php b/tests/Entities/InvalidRelationshipPost.php index 7faa537..078cd2c 100644 --- a/tests/Entities/InvalidRelationshipPost.php +++ b/tests/Entities/InvalidRelationshipPost.php @@ -2,18 +2,18 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; class InvalidRelationshipPost extends Model { use SoftDeletes, CascadeSoftDeletes; - protected $table = 'posts'; - public $dates = ['deleted_at']; + protected $table = 'posts'; + protected $cascadeDeletes = ['comments', 'invalidRelationship', 'anotherInvalidRelationship']; protected $fillable = ['title', 'body']; diff --git a/tests/Entities/NonSoftDeletingPost.php b/tests/Entities/NonSoftDeletingPost.php index 0ea1239..1547d49 100644 --- a/tests/Entities/NonSoftDeletingPost.php +++ b/tests/Entities/NonSoftDeletingPost.php @@ -2,8 +2,8 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; +use Dyrynda\Database\Support\CascadeSoftDeletes; class NonSoftDeletingPost extends Model { diff --git a/tests/Entities/Post.php b/tests/Entities/Post.php index 4748735..2bfc695 100644 --- a/tests/Entities/Post.php +++ b/tests/Entities/Post.php @@ -2,9 +2,9 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; class Post extends Model { diff --git a/tests/Entities/PostWithMissingRelationshipMethod.php b/tests/Entities/PostWithMissingRelationshipMethod.php index 0fd01ae..33da113 100644 --- a/tests/Entities/PostWithMissingRelationshipMethod.php +++ b/tests/Entities/PostWithMissingRelationshipMethod.php @@ -2,18 +2,18 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; class PostWithMissingRelationshipMethod extends Model { use SoftDeletes, CascadeSoftDeletes; - protected $table = 'posts'; - public $dates = ['deleted_at']; + protected $table = 'posts'; + protected $cascadeDeletes = 'comments'; protected $fillable = ['title', 'body']; diff --git a/tests/Entities/PostWithStringCascade.php b/tests/Entities/PostWithStringCascade.php index 52120a3..25e0ac5 100644 --- a/tests/Entities/PostWithStringCascade.php +++ b/tests/Entities/PostWithStringCascade.php @@ -2,18 +2,18 @@ namespace Tests\Entities; -use Iatstuti\Database\Support\CascadeSoftDeletes; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use Dyrynda\Database\Support\CascadeSoftDeletes; class PostWithStringCascade extends Model { use SoftDeletes, CascadeSoftDeletes; - protected $table = 'posts'; - public $dates = ['deleted_at']; + protected $table = 'posts'; + protected $cascadeDeletes = 'comments'; protected $fillable = ['title', 'body'];