1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-21 23:32:39 +00:00

Update Contact model

This commit is contained in:
Daniel Supernault 2024-10-10 01:53:16 -06:00
parent 7820b506d8
commit 11da5605b2
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -3,16 +3,31 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Contact extends Model
{
protected $casts = [
'responded_at' => 'datetime',
];
public function user()
{
return $this->belongsTo(User::class);
return $this->belongsTo(User::class);
}
public function adminUrl()
{
return url('/i/admin/messages/show/' . $this->id);
return url('/i/admin/messages/show/'.$this->id);
}
public function userResponseUrl()
{
return url('/i/contact-admin-response/'.$this->id);
}
public function getMessageId()
{
return $this->id.'-'.(string) Str::uuid().'@'.strtolower(config('pixelfed.domain.app', 'example.org'));
}
}