mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2025-12-10 14:15:47 -05:00
Almost complete site
Add dark / light theme Add social sharing on meme pages Add approving / pending admin section Improve design Add pagination on profiles Make front end date time user friendly Finish rough draft of site And Much more... Still need to fix a few minor things before it goes live. Almost complete.
This commit is contained in:
parent
52a9007882
commit
dbfda5cf9e
39 changed files with 54195 additions and 663 deletions
|
|
@ -4,16 +4,25 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Meme extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $appends = ['meme_tips_total'];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::addGlobalScope('approved', function (Builder $builder) {
|
||||
$builder->where('is_approved', 1);
|
||||
});
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
|
@ -26,12 +35,12 @@ class Meme extends Model
|
|||
|
||||
public function tips()
|
||||
{
|
||||
return $this->hasManyThrough(Tip::class, Address::class, 'id', 'address_id', 'address_id', 'id');
|
||||
return $this->hasManyThrough(Tip::class, Address::class, 'id', 'address_id', 'address_id', 'id')->orderBy('created_at', 'DESC');
|
||||
}
|
||||
|
||||
public function getMemeTipsTotalAttribute()
|
||||
{
|
||||
return $this->tips->sum('amount_formatted');
|
||||
return $this->tips->where('is_deposit', 1)->sum('amount_formatted');
|
||||
}
|
||||
|
||||
public function setImageAttribute($value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue