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

Fm Elfinder Bundle Laravel Package

alxishin/fm-elfinder-bundle

View on GitHub
Deep Wiki
Context7

Flysystem example configuration

You will need library files to work with Flysystem:

First add flysystem elfinder driver:

  composer require barryvdh/elfinder-flysystem-driver

Depending which driver you want to use, you need require appropriate driver, for example:

  composer require league/flysystem-aws-s3-v3

Below example of configuring flysystem:

fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
            editor: ckeditor # other options are tinymce, tinymce4, form, custom and simple
            fullscreen: true # defaults true, applies to simple and ckeditor editors
            connector:
                debug: false # defaults to false
                roots:       # at least one root must be defined
                      local:
                          driver: Flysystem
                          path: uploads
                          flysystem:
                              type: local
                              options:
                                local:
                                    path: %kernel.root_dir%/../web/uploads/
                          upload_allow: ['all']
                          #upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                          #upload_deny: ['all']
                          upload_max_size: 2M
                      dropbox:
                          driver: Flysystem
                          path: uploads
                          flysystem:
                              type: dropbox
                              options:
                                dropbox:
                                    app: YourAppname // see dropbox developer site
                                    token: ToKeN // can be aquired via developer console
                          upload_allow: ['all']
                      aws_s3:
                          driver: Flysystem
                          path: uploads
                          url: 'http://[my-bucket-name].s3.[region].amazonaws.com'
                          tmb_url: 'self' # For thumbnail generation on aws
                          flysystem:
                              type: aws_s3_v3
                              options:
                                aws_s3_v3:
                                    verion: 'latest'
                                    key: 'MY_AWS_KEY'
                                    secret: 'MY_AWS_SECRET'
                                    region: 'MY_AWS_REGION'
                                    bucket_name: 'MY_BUCKET_NAME'
                          upload_allow: ['all']

for more options see ElFinderConfigurationReader.php

Amazon S3 Configuration

To work with your S3 account and upload your files directly to S3 you have to set the following properties in your config file (config.yml).

fm_elfinder:
    instances:
        default:
            locale: %locale%
            editor: ckeditor
            fullscreen: true
            relative_path: false
            connector:
                debug: false
                roots:
                  aws_s3:
                      driver: Flysystem
                      path: uploads
                      url: 'http://[my-bucket-name].s3.[region].amazonaws.com'
                      tmb_url: 'self' # For thumbnail generation on aws
                      flysystem:
                          type: aws_s3_v3
                          options:
                            aws_s3_v3:
                                verion: 'latest'
                                key: 'MY_AWS_KEY'
                                secret: 'MY_AWS_SECRET'
                                region: 'MY_AWS_REGION'
                                bucket_name: 'MY_BUCKET_NAME'
                      upload_allow: ['all']

In that case you use an S3 domain so the relative_path have to be false and the url have to be set to your S3 or Cloudfront Domain if you have mapped S3 directly to your filesystem wirk with the relative path.

If you don't set the relative_path to false you get a wrong URL after inserting that image to CKEditor for example. Define the variables in your config.yml or set it directly.

Also possible to define Flysystem adapters as services, it can be useful for self written adapters. To use adapter as service, define it under 'services' node in your services.yml (or use DI)

services:
    local_adapter:
        class: League\Flysystem\Adapter\Local
        arguments: ["%kernel.root_dir%/../web/uploads/"]

and configure flysystem node accordingly to use it

fm_elfinder:
    instances:
        adapter:
            locale: %locale%
            editor: simple
            relative_path: true
            connector:
                roots:      
                    uploads:
                        show_hidden: false
                        driver: Flysystem # !set driver to Flysystem
                        flysystem:
                            type: custom # !set type to custom, it will tell bundle to use custom driver
                            adapter_service: 'local_adapter' # select previously configured adapter service
                            options:
                        path: ''
                        upload_allow: ['all']
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