Open vayurobins opened 4 years ago
Hi perhaps this is supported by installing this plugin: https://github.com/nielsboogaard/filepond-plugin-get-file, can you have a try if it works I can incorporate into this field
Another approach could be to only show this field on forms with ->onlyOnForms()
and then create a "fake" text field where you can do whatever you want, for example:
Text::make('Attachments', function () {
$html = '';
foreach ($this->attachments ?? [] as $attachment) {
$html .= '<li><a href="'.$attachment.'">'.$attachment.'</a></li>';
}
return $html ? '<ul>'.$html.'</ul>' : null;
})->asHtml()->onlyOnDetail(),
@royduin I modified your code a bit. Hopefully, this works for me.
Text::make('documents', function () {
$appUrl = Config::get('app.url'); // Fetch the APP_URL from the configuration
$html = '';
foreach ($this->documents ?? [] as $document) {
$html .= '<li><a href="' . $appUrl . '/storage/' . $document . '" target="_blank">' . $appUrl . '/storage/' . $document . '</a></li>';
}
return $html ? '<ul>' . $html . '</ul>' : null;
})->asHtml()->onlyOnDetail(),
Hi. Is it possible to have a download link to the uploaded file after it has been saved to the database/S3?