I'm creating a file share module, and I want to know how to create an specific path to my directory as a disk, putting as default on Configconfig.php, and been overwrited by .env variable MODULE_DISK_PATH
You can configure disks like in any laravel app, in the filesystems.php configuration file.
I'll close this due to inactivity.
It is possible to register disks within modules by creating a service provider that appends your config to the "filesystems.disks" option.
You can then add your own logic to this file (load your custom config, MODULE_DISK_PATH env variable etc...).
Basic example:
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$moduleName = 'mymodule';
Config::set('filesystems.disks.' . $moduleName . '.disk1', [
'driver' => 'local',
'root' => storage_path('app/modules/' . $moduleName . '/disk1'),
'visibility' => 'public',
]);
}
Most helpful comment
It is possible to register disks within modules by creating a service provider that appends your config to the "filesystems.disks" option.
You can then add your own logic to this file (load your custom config, MODULE_DISK_PATH env variable etc...).
Basic example: