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/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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
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