| Package Data | |
|---|---|
| Maintainer Username: | zobov | 
| Maintainer Contact: | ddzobov@gmail.com (Daniil Zobov) | 
| Package Create Date: | 2020-01-16 | 
| Package Last Update: | 2025-03-05 | 
| Home Page: | |
| Language: | PHP | 
| License: | MIT | 
| Last Refreshed: | 2025-11-03 15:21:23 | 
| Package Statistics | |
|---|---|
| Total Downloads: | 410,072 | 
| Monthly Downloads: | 13,681 | 
| Daily Downloads: | 368 | 
| Total Stars: | 66 | 
| Total Watchers: | 3 | 
| Total Forks: | 17 | 
| Total Open Issues: | 7 | 
Require this package with composer:
composer require ddzobov/laravel-pivot-softdeletes
use DDZobov\PivotSoftDeletes\Model;
class Post extends Model
{
    public function tags()
    {
        return $this->belongsToMany(Tag::class)->withSoftDeletes();
    }
}
class Tag extends Model
{
    public function posts()
    {
        return $this->belongsToMany(Post::class)->withSoftDeletes();
    }
}
use Illuminate\Database\Eloquent\Model;
use DDZobov\PivotSoftDeletes\Concerns\HasRelationships;
class Post extends Model
{
    use HasRelationships;
    public function tags()
    {
        return $this->belongsToMany(Tag::class)->withSoftDeletes();
    }
}
class Tag extends Model
{
    use HasRelationships;
    public function posts()
    {
        return $this->belongsToMany(Post::class)->withSoftDeletes();
    }
}
use DDZobov\PivotSoftDeletes\Model;
use DDZobov\PivotSoftDeletes\Relations\Pivot;
class Post extends Model
{
    public function tags()
    {
        return $this->belongsToMany(Tag::class)->using(PostTag::class)->withSoftDeletes();
    }
}
class Tag extends Model
{
    public function posts()
    {
        return $this->belongsToMany(Post::class)->using(PostTag::class)->withSoftDeletes();
    }
}
class PostTag extends Pivot
{
    
}
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\SoftDeletes;
use DDZobov\PivotSoftDeletes\Concerns\HasRelationships;
class Post extends Model
{
    use HasRelationships;
    public function tags()
    {
        return $this->belongsToMany(Tag::class)->using(PostTag::class)->withSoftDeletes();
    }
}
class Tag extends Model
{
    use HasRelationships;
    public function posts()
    {
        return $this->belongsToMany(Post::class)->using(PostTag::class)->withSoftDeletes();
    }
}
class PostTag extends Pivot
{
    use SoftDeletes;
}
$this->belongsToMany(Post::class)->withSoftDeletes('custom_deleted_at');
composer test
The MIT License (MIT). Please see License File for more information.