Trix field with files does not work in Action fields
webard opened this issue · 0 comments
webard commented
- Laravel Version: 11.0.7
- Nova Version: 4.33.3
- PHP Version: 8.2.19
- Database Driver & Version: MySQL 8.3.0
- Operating System and Version: MacOS 14.5
- Browser type and version: Chrome 124.0.6367.208
Description:
Action with Trix
field which enabled file upload does not upload files correctly.
Action
is appended to User
resource:
<?php
namespace App\Nova\Actions;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\Trix;
use Laravel\Nova\Http\Requests\NovaRequest;
class TestAction extends Action
{
public function fields(NovaRequest $request)
{
return [
Trix::make('Reason')->withFiles('public')
];
}
}
After pasting image to Trix field in Nova, there is 404 error:
Failed to load resource: the server responded with a status of 404 (Not Found): http://127.0.0.1:8000/nova-api/users/field-attachment/reason
Uploading when Trix field is added to Resource works correctly.
Detailed steps to reproduce the issue on a fresh Nova installation:
- Create Action
- Append it to any Resource
- Add
Trix
field to Action and enable upload bywithFiles()
method - Try to paste image to Trix field on Nova UI