templates
This commit is contained in:
parent
d07a222492
commit
2c12297d93
7
app/Models/Template.php
Normal file
7
app/Models/Template.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Template extends Model {}
|
7
app/Models/TemplateCategory.php
Normal file
7
app/Models/TemplateCategory.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class TemplateCategory extends Model {}
|
@ -44,6 +44,7 @@ public static function ohifSegmentation(string $study_uid): string
|
|||||||
|
|
||||||
return (string) $url;
|
return (string) $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function archive(string $study_uid): string
|
public static function archive(string $study_uid): string
|
||||||
{
|
{
|
||||||
$url = Url::createFromUrl(config('pacs.api.endpoint'));
|
$url = Url::createFromUrl(config('pacs.api.endpoint'));
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('template_categories', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('template_categories');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('templates', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->foreignId('category_id')->constrained('template_categories')->cascadeOnDelete();
|
||||||
|
$table->foreignId('owner_id')->nullable()->constrained('users')->nullOnDelete();
|
||||||
|
$table->boolean('is_private')->default(false);
|
||||||
|
$table->unsignedTinyInteger('priority')->default(0);
|
||||||
|
$table->string('title');
|
||||||
|
$table->longText('content');
|
||||||
|
$table->string('tags')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->index(['is_private', 'priority', 'title']);
|
||||||
|
$table->index(['category_id', 'is_private', 'priority', 'title']);
|
||||||
|
$table->index(['owner_id', 'is_private', 'priority', 'title']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('templates');
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user