mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
Update Contact model
This commit is contained in:
parent
7820b506d8
commit
11da5605b2
1 changed files with 17 additions and 2 deletions
|
@ -3,9 +3,14 @@
|
|||
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);
|
||||
|
@ -15,4 +20,14 @@ class Contact extends Model
|
|||
{
|
||||
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'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue