Skip to content

Configuration ​

Edit config/filament-sanchaya.php after publishing.

php
return [
    // Eloquent model for file records
    'model' => \DP0\Sanchaya\Models\SanchayaFile::class,

    // Eloquent model for polymorphic attachments
    'attachment_model' => \DP0\Sanchaya\Models\SanchayaAttachment::class,

    // Gate policy for file operations. null = no authorization.
    'policy' => \DP0\Sanchaya\Policies\SanchayaFilePolicy::class,

    // true = soft deletes (recoverable); false = hard delete
    'soft_deletes' => true,

    'allowed_disks' => null,

    'default_disk' => env('SANCHAYA_DEFAULT_DISK', 'public'),

    'file' => [
        'max_file_size'       => 10240,  // KB - 10 MB
        'accepted_file_types' => [],     // e.g. ['image/*']
    ],

    'storage_quota' => null, // bytes; null = unlimited

    'actions' => [
        'download' => [
'enabled' => true,
'label' => 'Download',
'icon' => 'heroicon-m-arrow-down-tray',
'class' => \DP0\Sanchaya\Actions\DownloadAction::class,
        ],
        'create_folder' => [
'enabled' => true,
'label' => 'Create Folder',
'icon' => 'heroicon-m-folder-plus',
'class' => \DP0\Sanchaya\Actions\CreateFolderAction::class,
        ],
        'rename' => [
'enabled' => true,
'label' => 'Rename',
'icon' => 'heroicon-m-pencil',
'class' => \DP0\Sanchaya\Actions\RenameAction::class,
        ],
        'move' => [
'enabled' => true,
'label' => 'Move',
'icon' => 'heroicon-m-arrow-right-circle',
'class' => \DP0\Sanchaya\Actions\MoveAction::class,
        ],
        'copy' => [
'enabled' => true,
'label' => 'Copy',
'icon' => 'heroicon-m-document-duplicate',
'class' => \DP0\Sanchaya\Actions\CopyAction::class,
        ],
        'delete' => [
'enabled' => true,
'label' => 'Delete',
'icon' => 'heroicon-m-trash',
'class' => \DP0\Sanchaya\Actions\DeleteAction::class,
        ],
    ],

    'sanchaya_picker' => [
        'multiple' => false,
        'allowed_types' => [], // e.g. ['image']
        'max_files' => null,
    ],
];

Config Reference

KeyDefaultDescription
modelSanchayaFileEloquent class for file records.
attachment_modelSanchayaAttachmentEloquent class for pivot.
policySanchayaFilePolicyGate policy controlling file operations.
soft_deletestrueWhether deletes are recoverable.
allowed_disksnullList of visible disks; null allows all configured disks.
default_diskpublicDisk shown when the manager opens.
file.max_file_size10240Upload size limit in KB.
file.accepted_file_types[]Accepted upload MIME types; empty allows all types.
storage_quotanullPer-disk upload quota in bytes, based on active indexed files; null means unlimited.
actions.*.enabledtrueEnable or disable a manager action. preview is UI-only; the other actions can use custom classes.
actions.*.labelAction labelText shown for the action in buttons, menus, and notifications.
actions.*.iconHeroicon nameIcon shown for the action in the file manager.
actions.*.classAction classOverride the service class resolved for download, create_folder, rename, move, copy, or delete.
sanchaya_pickerSingle selectionDefault multiple, allowed_types, and max_files values for picker fields.

Released under the MIT License.