PHP code example of deepcube / handoff-image-upload
1. Go to this page and download the library: Download deepcube/handoff-image-upload library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
deepcube / handoff-image-upload example snippets
use Deepcube\HandoffImageUpload\HandoffImageUpload;
public static function form(Form $form): Form
{
return $form
->schema([
HandoffImageUpload::make('profile_image')
->label('Profile Image'),
HandoffImageUpload::make('document_scan')
->label('Document Scan'),
// Other fields...
]);
}
namespace App\Filament\Resources;
use App\Models\User;
use Deepcube\HandoffImageUpload\HandoffImageUpload;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
class UserResource extends Resource
{
protected static ?string $model = User::class;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->label('Name')
->
protected function schedule(Schedule $schedule)
{
// Daily cleanup of temporary images older than 24 hours
$schedule->command('handoff-image:cleanup-temp')
->daily()
->at('02:00');
// Or every 6 hours
$schedule->command('handoff-image:cleanup-temp --hours=6')
->everySixHours();
}
// lang/vendor/handoff-image-upload/es/handoff-image-upload.php
return [
'take_photo_instruction' => 'Toma una foto para subirla',
'switch_camera' => 'Cambiar cámara',
'take_photo' => 'Tomar foto',
'retry' => 'Reintentar',
'confirm' => 'Confirmar',
// ... other translations
];