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

Mediabundle Laravel Package

alpixel/mediabundle

View on GitHub
Deep Wiki
Context7

AlpixelMediaBundle

SensioLabsInsight Build Status StyleCI Scrutinizer Code Quality Latest Stable Version

The AlpixelMediaBundle is a bundle managing media of all kinds for our projects.

Installation

  • Install the package
composer require 'alpixel/mediabundle:~2.0'
  • Update AppKernel.php

    <?php
    // app/AppKernel.php

    // ...
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                new Alpixel\Bundle\MediaBundle\AlpixelMediaBundle(),
            );

            // ...
        }

        // ...
    }
  • Update DB Schema
php app/console doctrine:schema:update
  • Update your config.yml
twig:
    ...
    form:
        resources:
            - 'AlpixelMediaBundle:Form:fields.html.twig'


alpixel_media:
    upload_folder: "%kernel.root_dir%/../web/upload/"
    allowed_mimetypes: ['image/*', 'application/pdf']
    
liip_imagine:
    resolvers:
        default:
            web_path:
                web_root: %alpixel_media.upload_folder%
                cache_prefix: filters
    filter_sets:
        cache: ~
        admin:
            quality: 100
            filters:
                auto_rotate: ~
                thumbnail: { size: [140, 93], mode: outbound }
  • Add the routing
alpixel_media:
    resource: '@AlpixelMediaBundle/Resources/config/routing.yml'
  • Use it in front

There is a twig extension capable of generating URLs, you can call it this way :

<img src='{{myMedia|media_url}}' />
<img src='{{myMedia|media_url({public: false})}}' />

Available options are :

  • public : [true]/false should the url be SEO friendly or not ?
  • absolute : true/[false] should the URL be relative or not ?
  • action : [show]/download what kind of action is expected.
  • filter : the liip imagine filter used to render the image. Defaults to null (the original one)

You can also generate the URL by hand. Just look at the MediaController@showMediaAction to see what are the URL expected.

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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity