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:
parent
7820b506d8
commit
11da5605b2
1 changed files with 17 additions and 2 deletions
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue