Askedio / laravel-soft-cascade

Cascade Delete & Restore when using Laravel SoftDeletes
https://medium.com/asked-io/cascading-softdeletes-with-laravel-5-a1a9335a5b4d
MIT License
705 stars 63 forks source link

Use with Awobaz Comboships #89

Closed NaturalDevCR closed 4 years ago

NaturalDevCR commented 5 years ago

Hi, first than all thanks for this package, it's really helpful,

i use Awobaz Comboships to make relations between models with more than one colunm, like this:

public function jobs()
    {
        return $this->hasMany('App\UserJob', ['user_id', 'client_id', 'destination_id'], ['user_id', 'client_id', 'destination_id']);
    }

that way i can relate models specifically with more terms, i tried to use softdeletes with this, but nothing happened... any ideas? hints?

This is the model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class UserClientDestination extends Model
{
    use SoftDeletes;
    use \Awobaz\Compoships\Compoships;
    use \Askedio\SoftCascade\Traits\SoftCascadeTrait;

    protected $softCascade = ['jobs'];

    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */
    protected $dates = ['deleted_at'];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id',
        'client_id',
        'destination_id',
        'name',
        'sub_name',
        'zone_id',
    ];

    public function jobs()
    {
        return $this->hasMany('App\UserJob', ['user_id', 'client_id', 'destination_id'], ['user_id', 'client_id', 'destination_id']);
    }

}
maguilar92 commented 5 years ago

@LaravDev Sorry for the delay on respond. I will check it as soon as possible.

NaturalDevCR commented 5 years ago

No worries, thanks in advance man!

maguilar92 commented 4 years ago

@LaravDev We will not develop this feature. You are free to create and submit a pull request with the enhacement or extend our package to your needs.