„Dokumente“ heißt jetzt „Downloads“
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m50s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m18s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m19s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m50s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m18s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m19s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
Der Name „Dokumente“ bleibt dem kommenden QM-Modul (QM-Dokumente und -Formulare) vorbehalten. - Plugin plugins-core/downloads (Inhaus\Plugins\Downloads), Adresse /downloads, Rechte downloads.*, Objekttyp download_folder, Block downloads.folder, Kachel downloads.favorites - Migration für bestehende Installationen: Tabellen und Spalten, Rechte, Sichtbarkeiten, Menü, Startseiten-Anordnung, Blöcke in Seiten und Fassungen, Plugin-Zustand; mit Test - Alte Links unter /dokumente leiten dauerhaft weiter Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c71131d054
commit
f78cc96be7
120 changed files with 1091 additions and 866 deletions
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Documents\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Inhaus\Plugins\Documents\FolderTree;
|
||||
|
||||
#[Fillable(['parent_id', 'name', 'description', 'sort', 'created_by'])]
|
||||
class DocumentFolder extends Model
|
||||
{
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::saved(fn (DocumentFolder $folder) => FolderTree::flush($folder->wasRecentlyCreated || $folder->wasChanged('parent_id')));
|
||||
static::deleted(fn () => FolderTree::flush(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{0: string, 1: int}
|
||||
*/
|
||||
public function permissionResource(): array
|
||||
{
|
||||
return ['document_folder', $this->id];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<DocumentFolder, $this>
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DocumentFolder::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<DocumentFolder, $this>
|
||||
*/
|
||||
public function children(): HasMany
|
||||
{
|
||||
return $this->hasMany(DocumentFolder::class, 'parent_id')->orderBy('sort')->orderBy('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<Document, $this>
|
||||
*/
|
||||
public function documents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Document::class, 'folder_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue