The issue you are trying to resolve with you PR can be handled in a different way. Also the controllers of the package can't hold your specific logic.
You may want to configure the tool or the field to resolve the filesystem depending of your needs. According to the documentation you can use an on-demand filesystem.
// app/Nova/AResource.php
use Oneduo\NovaFileManager\FileManager;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use Laravel\Nova\Http\Requests\NovaRequest;
class AResource extends Resource
{
// ...
public function fields(NovaRequest $request): array
{
return [
// ... any other fields
FileManager::make(__('Attachments'), 'attachments')
->filesystem(function (NovaRequest $request): string|Filesystem {
// create a filesystem on user basis
$config = $request->user()->location->storage()->getConfig();
return Storage::build([
'driver' => $config['driver'],
'root' => $config['root'],
'url' => config('app.url').$config['url'],
]);
}),
];
}
}
Of course you'll need to adapt this code to your needs.
Hi @KarimiCosalux
The issue you are trying to resolve with you PR can be handled in a different way. Also the controllers of the package can't hold your specific logic.
You may want to configure the tool or the field to resolve the filesystem depending of your needs. According to the documentation you can use an on-demand filesystem.
Of course you'll need to adapt this code to your needs.
Hope this will help you.
All the best.