PHP code example of alenadashko / filament-cloud-file-links

1. Go to this page and download the library: Download alenadashko/filament-cloud-file-links 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/ */

    

alenadashko / filament-cloud-file-links example snippets


use FilamentCloudFileLinks\Forms\Components\CloudFileLinks;

CloudFileLinks::make('cloud_files')
    ->label('Cloud files')

protected $casts = [
    'cloud_files' => 'array',
];

[
    'Contract.pdf' => 'https://storage.example.com/files/abc123',
    'Passport scan' => 'https://storage.example.com/files/def456',
]

CloudFileLinks::make('cloud_files')
    ->fileLabel('Documents')
    ->emptyLabel('No documents yet')
    ->nameFieldLabel('Name')
    ->urlFieldLabel('URL')
    ->nameFieldPlaceholder('e.g. Certificate of completion')
    ->urlFieldPlaceholder('https://...')
    ->addActionLabel('Add document')
    ->editActionLabel('Edit document')
    ->addable()
    ->deletable()
    ->deleteRequiresConfirmation()
    ->deleteConfirmationModalHeading('Delete document')
    ->deleteConfirmationModalDescription('This cannot be undone.')
    ->deleteConfirmationModalSubmitActionLabel('Yes, delete')
    ->deleteConfirmationModalCancelActionLabel('Cancel')
    ->editableKeys()   // together with editableValues controls the Edit button
    ->editableValues();