芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Models/ExpenseRecurring.php
belongsTo(Currency::class, 'currency_id'); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id')->withoutGlobalScope(ActiveScope::class); } public function project(): BelongsTo { return $this->belongsTo(Project::class, 'project_id'); } public function createdBy(): BelongsTo { return $this->belongsTo(User::class, 'created_by')->withoutGlobalScope(ActiveScope::class); } public function category(): BelongsTo { return $this->belongsTo(ExpensesCategory::class, 'category_id'); } public function recurrings(): HasMany { return $this->hasMany(Expense::class, 'expenses_recurring_id'); } public function getTotalAmountAttribute() { if (!is_null($this->price) && !is_null($this->currency_id)) { return currency_formatter($this->price, $this->currency->currency_symbol); } return ''; } public function getCreatedOnAttribute() { if (!is_null($this->created_at)) { return $this->created_at->format($this->company->date_format); } return ''; } public function getBillUrlAttribute() { return ($this->bill) ? asset_url(Expense::FILE_PATH . '/' . $this->bill) : ''; } }