Skip to content

Commit

Permalink
update namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldyrynda committed Sep 8, 2020
1 parent 7e785d1 commit 5db49c8
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"autoload": {
"psr-4": {
"Iatstuti\\Database\\Support\\": "src/"
"Dyrynda\\Database\\Support\\": "src/"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/CascadeSoftDeleteException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Iatstuti\Database\Support;
namespace Dyrynda\Database\Support;

use Exception;
use Illuminate\Support\Str;
Expand Down
7 changes: 2 additions & 5 deletions src/CascadeSoftDeletes.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?php

namespace Iatstuti\Database\Support;
namespace Dyrynda\Database\Support;

use LogicException;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\Relation;

trait CascadeSoftDeletes
Expand All @@ -31,7 +28,7 @@ protected static function bootCascadeSoftDeletes()
/**
* Validate that the calling model is correctly setup for cascading soft deletes.
*
* @throws \Iatstuti\Database\Support\CascadeSoftDeleteException
* @throws \Dyrynda\Database\Support\CascadeSoftDeleteException
*/
protected function validateCascadingSoftDelete()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/CascadeSoftDeletesIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use PHPUnit\Framework\TestCase;
use Illuminate\Events\Dispatcher;
use Iatstuti\Database\Support\CascadeSoftDeleteException;
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager;
use Dyrynda\Database\Support\CascadeSoftDeleteException;

class CascadeSoftDeletesIntegrationTest extends TestCase
{
Expand Down Expand Up @@ -52,7 +52,6 @@ public static function setupBeforeClass(): void
});

$manager->schema()->create('authors__post_types', function ($table) {

$table->increments('id');
$table->integer('author_id');
$table->integer('posttype_id');
Expand Down
2 changes: 1 addition & 1 deletion tests/Entities/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Entities/InvalidRelationshipPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
2 changes: 1 addition & 1 deletion tests/Entities/NonSoftDeletingPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Entities/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Entities/PostWithMissingRelationshipMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
6 changes: 3 additions & 3 deletions tests/Entities/PostWithStringCascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit 5db49c8

Please sign in to comment.