Added a ticket queues object to organize tickets; added ability to change a ticket's queue

This commit is contained in:
2022-12-04 21:33:21 -05:00
parent 15ee9b78a3
commit 80a12a86ef
12 changed files with 261 additions and 16 deletions

36
src/Models/Queue.php Normal file
View 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");
}
}