Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Resulting filename on form action is prefixed with / #32

Open
nikspyratos opened this issue Aug 4, 2024 · 0 comments
Open

[Bug]: Resulting filename on form action is prefixed with / #32

nikspyratos opened this issue Aug 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nikspyratos
Copy link

What happened?

I noticed on some custom actions with file uploads that the resulting filename of the FileUpload now has a / prefix on the filename, where it doesn't usually.

Not a train smash as you can just do a Str::replace('/', '', $data['file']), but worth noting.

How to reproduce the bug

Have an action with a fileupload and an action callback. $data['file'] will have a / at the beginning, whereas without optimize it does not.

Action::make()
    ->label('Upload Delivery Note')
    ->form([
        FileUpload::make('file')
            ->image()
            ->optimize('jpg'),
    ])
    ->action(function (Model $record, array $data) {
        dd($data['file']); //'/randomfilename.jpg'
    });

Package Version

1.4.1

PHP Version

8.3.9

Laravel Version

11.19.0

Which operating systems does with happen with?

macOS

Notes

Side note, if it hasn't been tested before, package handles (or rather doesn't error with) non-image uploads for uploads with multiple filetypes, so very useful :)

@nikspyratos nikspyratos added the bug Something isn't working label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant