Skip to content

Conversation

@binaryk
Copy link
Collaborator

@binaryk binaryk commented Dec 13, 2025

🎉 New Feature: Base64File Field

Handle base64-encoded file uploads directly in your Restify repositories - perfect for signature pads, canvas drawings, webcam captures, and image editors.

Usage

  use Binaryk\LaravelRestify\Fields\Base64File;

  Base64File::make('signature')
      ->path('signatures')
      ->disk('s3')
      ->storeAs(fn($request) => 'sig-'.now()->timestamp)
      ->resolveUsingTemporaryUrl(true, now()->addMinutes(30));

Request

  {
    "signature": "data:image/png;base64,iVBORw0KGgo..."
  }

Features

  • Auto-detects MIME type from data URI (png, jpg, gif, webp, svg, pdf)
  • Inherits all File field capabilities (disk(), path(), storeAs(), prunable(), deletable())
  • Falls back to regular file upload or URL handling when not base64
  • Works with resolveUsingTemporaryUrl() for S3 signed URLs

Use Cases

  • Signature pads
  • Image editors / croppers
  • Webcam captures
  • Canvas-based drawing apps
  • Screenshot paste functionality

@vercel
Copy link

vercel bot commented Dec 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
laravel-restify-ol4i Ready Ready Preview, Comment Dec 13, 2025 6:44am

@binaryk binaryk merged commit 941cb03 into 10.x Dec 13, 2025
2 checks passed
@arthurkirkosa arthurkirkosa deleted the feat/base64-field branch December 13, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants