PHP code example of zeeshantariq / filament-attachmate

1. Go to this page and download the library: Download zeeshantariq/filament-attachmate 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/ */

    

zeeshantariq / filament-attachmate example snippets


use ZeeshanTariq\FilamentAttachmate\Core\InteractsWithAttachments;
// ...

class MyModel extends Model
{
    use InteractsWithAttachments;
    
    // ...
}

use ZeeshanTariq\FilamentAttachmate\Forms\Components\AttachmentFileUpload;

public static function form(Form $form): Form
{
    return $form
        ->schema([
            // ...

            AttachmentFileUpload::make(),
        ]);
}

use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments;

class CreateMyModel extends CreateRecord
{
    use HandleAttachments;

    // ...
}

use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments;

class EditMyModel extends EditRecord
{
    use HandleAttachments;

    // ...
}
bash
php artisan vendor:publish --tag="filament-attachmate-migrations"
bash
php artisan make:model MyModel