changes 0328092025

This commit is contained in:
Simon Pocrnjič
2025-09-28 22:36:47 +02:00
parent b40ee9dcde
commit 7e8e0a479b
61 changed files with 4306 additions and 654 deletions
+12 -1
View File
@@ -13,8 +13,8 @@
class Document extends Model
{
use HasFactory;
use Uuid;
use SoftDeletes;
use Uuid;
protected $fillable = [
'uuid',
@@ -80,4 +80,15 @@ protected static function booted(): void
}
});
}
/**
* Include soft-deleted documents when resolving by route key (e.g. {document:uuid}).
*/
public function resolveRouteBinding($value, $field = null)
{
// Always include trashed so deep-linking to older documents works
return static::withTrashed()
->where($field ?? $this->getRouteKeyName(), $value)
->firstOrFail();
}
}