Skip to content

Commit

Permalink
close #2199 Fixed: Transfer duplicate broken
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jul 23, 2021
1 parent e289df6 commit b523edf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/Models/Banking/Transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
use App\Models\Common\Media as MediaModel;
use App\Traits\Currencies;
use App\Traits\Media;
use Bkwld\Cloner\Cloneable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Znck\Eloquent\Traits\BelongsToThrough;

class Transfer extends Model
{
use BelongsToThrough, Currencies, HasFactory, Media;
use BelongsToThrough, Cloneable, Currencies, HasFactory, Media;

protected $table = 'transfers';

Expand All @@ -31,6 +32,13 @@ class Transfer extends Model
*/
public $sortable = ['expense.paid_at', 'expense.amount', 'expense.name', 'income.name'];

/**
* Clonable relationships.
*
* @var array
*/
public $cloneable_relations = ['expense_transaction', 'income_transaction'];

public function expense_transaction()
{
return $this->belongsTo('App\Models\Banking\Transaction', 'expense_transaction_id');
Expand Down

0 comments on commit b523edf

Please sign in to comment.