refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
54
app/Models/User/Changelog.php
Normal file
54
app/Models/User/Changelog.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\User;
|
||||
|
||||
use Parsedown;
|
||||
use App\Helpers\DateHelper;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Changelog extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array<string>|bool
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the user records associated with the tag.
|
||||
*/
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsToMany(User::class)->withPivot('read', 'upvote')->withTimestamps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the markdown parsed description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescriptionAttribute($value)
|
||||
{
|
||||
return (new Parsedown())->text($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the created_at date in a friendly format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedAtAttribute($value)
|
||||
{
|
||||
return DateHelper::getShortDate($value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user