mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2025-08-08 22:42:19 -04:00
Finish rough draft of website
Update the payment code so everything is working now Improve DB structure Improve design Add API Validate XMR Address upon registration And Much More... Still Need to work on: - SEO - Dropdown in menu (bug, not dropping down)
This commit is contained in:
parent
dbfda5cf9e
commit
821fb9b1ed
30 changed files with 186 additions and 261 deletions
|
@ -14,7 +14,14 @@ class Meme extends Model
|
|||
use SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $appends = ['meme_tips_total'];
|
||||
protected $appends = ['meme_tips_total', 'image_url'];
|
||||
protected $hidden = [
|
||||
'payment_pending',
|
||||
'account_index',
|
||||
'is_approved',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
|
@ -28,14 +35,9 @@ class Meme extends Model
|
|||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function address()
|
||||
{
|
||||
return $this->belongsTo(Address::class);
|
||||
}
|
||||
|
||||
public function tips()
|
||||
{
|
||||
return $this->hasManyThrough(Tip::class, Address::class, 'id', 'address_id', 'address_id', 'id')->orderBy('created_at', 'DESC');
|
||||
return $this->hasMany(Tip::class)->orderByDesc('created_at');
|
||||
}
|
||||
|
||||
public function getMemeTipsTotalAttribute()
|
||||
|
@ -43,6 +45,11 @@ class Meme extends Model
|
|||
return $this->tips->where('is_deposit', 1)->sum('amount_formatted');
|
||||
}
|
||||
|
||||
public function getImageUrlAttribute()
|
||||
{
|
||||
return url($this->image);
|
||||
}
|
||||
|
||||
public function setImageAttribute($value)
|
||||
{
|
||||
$attribute_name = "image";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue