Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

File Bundle Laravel Package

bengor/file-bundle

View on GitHub
Deep Wiki
Context7

Serving files from Twig

This bundles provides a simple Twig function that simplifies the download file process:

bengor_file_download

Keeping in mind that this bundle supports the multiple file configurations (check "Multiple files" chapter for more information). For example if you have to register in the config.yml

# app/config/config.yml

ben_gor_file:
    file_class:
        file:
            class: AppBundle\Entity\File
        image:
            class: AppBundle\Entity\Image

This method needs two arguments that is the file type and the file name and automatically it will generate a public url that exposes in a safe way the given file. If the file is an image you can wraps inside HTML img tag or an embed in case that file is, for example, a pdf.

{# your awesome twig template #}

<embed src="{{ bengor_file_download('file', 'pdf-file.pdf') }}" width="500" height="1000"/>

<img src="{{ bengor_file_download('image', 'image.jpg') }}"/>
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager