Skip to content

FileMagic v0.1.0

Latest

Choose a tag to compare

@mattmy mattmy released this 30 Jul 05:17

FileMagic's first public release provides one consistent Laravel workflow for
accepting, validating, storing, querying, downloading, and deleting files.

Highlights

  • Store uploads, local paths, strings or binary content, Base64 input, remote
    HTTP(S) files, and generated TXT, JSON, or CSV documents through PendingFile.
  • Inspect actual file content with PHP Fileinfo, streamed size and checksum
    calculation, MIME restrictions, normalized paths, visibility, metadata, and
    ownership.
  • Import remote files with TLS verification by default, SSRF protection,
    redirect and DNS validation, private-network restrictions, byte limits, and
    explicit HTML opt-in.
  • Resize supported images with optional Intervention Image 4 while preserving
    unsupported file formats unchanged.
  • Resolve IDs, UUIDs, stored-file models, arrays, Laravel Collections, and
    variadic targets through the unified FileMagic::find() API.
  • Create optional streamed ZIP downloads with bounded limits and safe entry
    names.
  • Recover failed overwrites, reconcile partial batch deletions, and audit
    database-to-storage consistency with the read-only-by-default
    file-magic:audit command.
  • Configure the stored-file model, connection, table, primary key, and owner
    relation.

Requirements

  • PHP 8.3 or later
  • Laravel 12 or 13
  • PHP ext-fileinfo
  • Optional PHP ext-curl for fromUrl()
  • Optional PHP ext-zip for ZIP downloads
  • Optional Intervention Image 4 with GD or Imagick for image processing

Read the complete documentation
or review the full changelog.