Added a ticket queues object to organize tickets; added ability to change a ticket's queue
This commit is contained in:
36
src/Models/Queue.php
Normal file
36
src/Models/Queue.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace BitGoblin\Goliath\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
class Queue extends Model {
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'description',
|
||||
];
|
||||
|
||||
public function tickets() {
|
||||
return $this->hasMany(Ticket::class);
|
||||
}
|
||||
|
||||
public function render(): string {
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
return $converter->convert($this->description);
|
||||
}
|
||||
|
||||
public function formatCreatedAt(): string {
|
||||
return date_format(date_create($this->created_at), "F jS\\, Y \\a\\t g:i:s a");
|
||||
}
|
||||
|
||||
public function formatUpdatedAt(): string {
|
||||
return date_format(date_create($this->updated_at), "F jS\\, Y \\a\\t g:i:s a");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user