mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
652 B
PHP
34 lines
652 B
PHP
<?php
|
|
|
|
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);
|
|
}
|
|
|
|
public function adminUrl()
|
|
{
|
|
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'));
|
|
}
|
|
}
|