Add project listing selector, confirmed revision and private 3MF renders
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\ProjectFileRenderFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ProjectFileRender extends Model
|
||||
{
|
||||
/** @use HasFactory<ProjectFileRenderFactory> */
|
||||
use HasFactory;
|
||||
|
||||
public const RENDERER_GD = 'gd';
|
||||
|
||||
public const RENDERER_SVG = 'svg';
|
||||
|
||||
protected $fillable = [
|
||||
'project_file_id', 'renderer', 'mime_type', 'storage_key', 'width', 'height',
|
||||
'triangle_count', 'instance_count', 'alt_text', 'byte_size', 'sha256',
|
||||
'generated_by', 'generated_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'generated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function projectFile(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ProjectFile::class);
|
||||
}
|
||||
|
||||
public function generator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'generated_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user