emmanpbarrameda/filament-take-picture-field

FilamentTakePictureField Component for Filament Forms

Fund package maintenance!
emmanpbarrameda

Installs: 1 683

Dependents: 0

Suggesters: 0

Security: 0

Stars: 14

Watchers: 1

Forks: 1

Open Issues: 2

Language:Blade

v1.0.0 2025-04-16 17:29 UTC

This package is auto-updated.

Last update: 2025-05-24 10:03:52 UTC


README

A custom Filament 3 form component to capture photos from your device camera.

Features

  • Take photos directly from the user's device camera
  • Seamless integration with Filament 3 forms
  • Configurable storage options (disk, directory, visibility)
  • Camera selector for devices with multiple cameras
  • Adjustable aspect ratio and image quality
  • Modal support for better user experience

Installation

composer require emmanpbarrameda/filament-take-picture-field

Requirements

  • PHP: ^8.1
  • Filament: ^3.0
  • A device with camera access (desktop or mobile)

Usage

Add the component to your Filament form:

use emmanpbarrameda\FilamentTakePictureField\Forms\Components\TakePicture;

// ...

TakePicture::make('camera_test')
    ->label('Camera Test')
    ->disk('public')
    ->directory('uploads/services/payment_receipts_proof')
    ->visibility('public')
    ->useModal(true)
    ->showCameraSelector(true)
    ->aspect('16:9')
    ->imageQuality(80)
    ->shouldDeleteOnEdit(false)

Configuration Options

Method Description
disk(string $disk) Set the storage disk for saving photos (default: 'public')
directory(string $directory) Set the directory path within the disk where photos will be stored
visibility(string $visibility) Set the file visibility (e.g., 'public', 'private')
useModal(bool $useModal) Enable or disable modal view for the camera (default: 'true')
showCameraSelector(bool $showSelector) Enable or disable camera selection option for devices with multiple cameras (default: 'true')
aspect(string $aspect) Set the aspect ratio for the captured image (e.g., '16:9', '4:3', '1:1')
imageQuality(int $quality) Set the JPEG quality of the captured image (0-100)
shouldDeleteOnEdit(bool $shouldDelete) Whether to delete the previous file when editing (default: 'false')

Screenshots

image image image

Contributing

This is version 1.0 of the filament-take-picture-field component plugin. Contributions and pull requests for improvements are welcome!

License

MIT

Glowing Star Get in touch

              


/e/