Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

serversideup/financial-freedom

2748 stars
2 code files
View serversideup/financial-freedom on GitHub

app/Models/Transactions/Transaction.php

Open in GitHub
use Illuminate\Database\Eloquent\Model;
 
class Transaction extends Model
{
//
protected $appends = ['is_split'];
//
public function splits()
{
return $this->hasMany('App\Models\Transactions\Split', 'transaction_id', 'id');
}
 
public function getIsSplitAttribute()
{
return $this->splits()->count() > 0 ? true : false;
}
//
}

resources/js/Pages/Transactions/Show/components/Breakdown.vue

Open in GitHub
// ...
 
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
<tags
v-if="!transaction.is_split"
:unique="'transaction-tags'"
:existing="transaction.tags"
/>
<div class="flex flex-col" v-if="transaction.is_split">
<div class="mb-1">
<span v-for="(tag, key) in splitTags"
v-bind:key="'transaction-split-'+key"
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium mr-1"
v-bind:class="[
'bg-'+tag.color+'-100', 'text-'+tag.color+'-800'
]">
{{ tag.name }}
</span>
</div>
<span class="text-xs italic">Transaction is split, tags are from splits.</span>
</div>
</dd>
 
// ...

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.