[5.x] Download on detail view not working with image field in repeater
- Dominant language
- No language data
- Stars
- 557
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
- Laravel Version: 12.19.0
- Nova Version: 5.7.3
- PHP Version: 8.4.8
- Database Driver & Version: PostgreSQL 17.4
- Operating System and Version: macOs 15.5
- Browser type and version: Firefox 139.0.1
### Description:
The download link on a resource detail view does not work for an image field in a repeater field. On click it tries to open a link like this:
https://example.com/nova-api/my-resource/1234/download/image
This results in a 404 error.
This is my Repeatable
```
namespace App\Nova\Repeater;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Image;
use Laravel\Nova\Fields\Repeater\Repeatable;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Http\Requests\NovaRequest;
class Module extends Repeatable
{
public function fields(NovaRequest $request): array
{
return [
ID::hidden('id'),
Image::make(__('Image'), 'image')
->rules(['nullable', 'image', 'max:1024'])
->disk('public')
->path('modules'),
Text::make(__('Title'), 'title')
->required()
->rules(['required', 'string', 'max:255']),
Textarea::make(__('Description'), 'description')
->required()
->rules(['required', 'string']),
];
}
}
```
It is used as this:
```
Repeater::make(__('Modules'), 'modules')
->repeatables([
Module::make(),
])
->uniqueField('id')
->asJson(),
```
Is this a bug or am I doing something wrong?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with Laravel 12.19.0, Nova 5.7.3, a PostgreSQL 17.4 database, and the provided Module repeater containing an Image field. Start from the detail-view download link and inspect why it targets /nova-api/my-resource/1234/download/image; done means the image download resolves instead of returning 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php, postgresql
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100