Skip to content

Support modifying the copied media assets in the build process #1981

@emmadesilva

Description

@emmadesilva

An interesting case brought up at the Laravel Meetup in Malmö was using the asset build pipeline to manipulate images. Had an idea on how to make this even easier to hook into. We could instead of copying files in the build process, call a compile/similar method on the instance. The default implementation is to return a binary copy of the source file that we write to disk, but a developer could create a custom media class that could for example override this method to read the source file, compress it, and return the compressed file binary contents which we then write. We would need a way to support swapping out the class so I feel this is something we can do at a later time, but we should add the plumbing to support the root stuff here.

Originally posted by @caendesilva in #1904 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions