Weave 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/file-bundle

View on GitHub
Deep Wiki
Context7

Multiple files

In case you need more than one file type you need to go across the following steps that are very similar to those you followed in basic configuration chapter.

First of all you need to define a new file model.

// src/AppBundle/Entity/Image.php

namespace AppBundle\Entity;

use BenGorFile\File\Domain\Model\File as BaseFile;
use Doctrine\ORM\Mapping as ORM;

/**
 * [@ORM](https://github.com/ORM)\Entity
 * [@ORM](https://github.com/ORM)\Table(name="image")
 */
class Image extends BaseFile
{
}

Next, you have to append the newly created class' definition to the one you created in the basic configuration chapter:

# app/config/config.yml

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

With only one file type declared in config.yml if you execute the

$ bin/console debug:container | grep .command_bus`

you'll see the following:

bengor_file.file.command_bus      BenGorFile\SimpleBusBridge\CommandBus\SimpleBusFileCommandBus  

Otherwise, if you execute the above command after add he second file type you'll see the following:

bengor_file.file.command_bus      BenGorFile\SimpleBusBridge\CommandBus\SimpleBusFileCommandBus  
bengor_file.image.command_bus     BenGorFile\SimpleBusBridge\CommandBus\SimpleBusFileCommandBus  

IMPORTANT! your_file_type mentioned across all the docs refers to the name you assign to each file model. The array key bellow file_class will be used for that. In this case file and image strings will be used to replace your_file_type in the examples you will find.

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.
dakiquang/laravel-oauth-refresh-lock
woda/laravel-worktrees
dalefranks/ramasite
faghy/laracashbook
roundly-consulting/google-places-for-laravel
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
adachsoft/changelog-linter