Download the PHP package krma-cl/kcfinder-laravel without Composer

On this page you can find all versions of the php package krma-cl/kcfinder-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kcfinder-laravel

KCFinder for Laravel

Official Laravel adapter for krma-cl/kcfinder. It connects Laravel filesystem, authorization, URL generation and native events to KCFinder while keeping the browser framework-independent.

Requirements

Installation

Configure the disk and browser URL in .env:

Define the authorization rule. The callback receives the operation and logical path:

Operations include browse, select, preview, upload, edit, copy, move, rename, delete and create_directory.

Optional authenticated classic browser

Version 1.4.3 can route the classic browser through Laravel instead of exposing a PHP entrypoint inside vendor. It is disabled by default. Enable it only behind your application's authenticated middleware:

The browser is then available at /kcfinder/browse.php. The bridge:

The classic browser currently requires a local Laravel filesystem disk because its image editor and legacy file operations use physical paths. S3 and other remote disks remain supported for descriptors and URL resolvers, but not for this optional HTTP browser bridge.

Publish static assets without copying executable PHP files:

kcfinder:clear-cache removes generated bundles and the .thumbs tree. Adjust the CSP and middleware in configuration when the browser must be embedded in a different trusted origin. When the Bootstrap 5 theme package is installed, kcfinder:install-assets detects it and publishes dist/bootstrap5 automatically. The generated application manifest records both installed package versions. The command also creates static base and theme bundles under bundles/. The authenticated HTML uses virtual, content-versioned URLs under browser-assets/, avoiding collisions with physical js/ and css/ directories on Apache. Those requests are resolved to the published bundles with the configured security headers. If assets have not been published yet, the bridge concatenates the trusted package sources directly without executing the legacy minifiers. js_localize.php is also rendered safely by the bridge and cannot terminate the Laravel process through its historical die. CSS bundles rebase relative url(...) references to the published css/ or themes/<theme>/ directories. Embedded data, absolute and external URLs, blob: values and fragments remain unchanged, so theme icons and Jcrop resources resolve correctly from the virtual bundle endpoints. The authenticated route also mounts the package as a trusted external theme root, so KCFinder can load its icons and dynamic bundles without copying it inside vendor/krma-cl/kcfinder/themes.

Selecting files

Resolve a selected file as a stable JSON-compatible descriptor:

A FileSelected event is dispatched after an authorized selection.

Separate preview and selected URLs

Applications no longer need to expose a storage path directly. Preview and final selected URLs can use different prefixes or temporary signed URLs:

For S3-compatible disks, setting a TTL makes the adapter request a temporary URL from Laravel's filesystem driver. If an application needs controller routes, authenticated previews or another strategy, bind the contracts in a service provider:

Both resolvers receive a normalized absolute logical path. Preview resolution is authorized with the preview operation before the resolver is called.

Structured operation responses

Version 1.1 adds a JSON-serializable operation result for upload, edit, move, rename, delete and directory creation. Wire it into the callbacks that already run after a successful KCFinder storage mutation:

Failures can retain a stable code, a useful message and their HTTP status:

If the file was saved but a secondary catalog operation failed, return a warning instead of a false upload failure:

The adapter does not replace the legacy KCFinder JavaScript response automatically. Structured mode is opt-in and can be introduced endpoint by endpoint without breaking existing installations.

Automatic classic browser bridge

KCFinder 4.8.1 exposes a neutral operation observer at the exact success points of the classic browser. The adapter registers ClassicBrowserBridge as its Laravel implementation, so integrations no longer need to call every report* method manually.

When the classic browser runs inside an already bootstrapped Laravel application, connect the observer in KCFinder's conf/config.local.php:

Do not bootstrap Laravel a second time from config.local.php. If browse.php is currently a completely independent public script, first expose it through the application's existing authenticated Laravel bootstrap or keep using the explicit report* methods until that boundary is available.

The bridge then performs this mapping automatically:

Classic operation Laravel event
upload, drag upload FileUploaded
image edit, crop FileEdited
move FileMoved
copy FileCopied
rename FileRenamed
delete FileDeleted
create directory DirectoryCreated
rename directory DirectoryRenamed
delete directory DirectoryDeleted

Move, rename and delete take their authorized snapshot before the filesystem mutation. Bulk operations emit one event for each file that actually succeeds. A listener exception is logged by the core observer boundary and does not turn an already completed filesystem mutation into a false failure response.

Manual report* calls remain available for custom JSON endpoints. Do not use both mechanisms for the same operation, or the application will dispatch duplicate events.

Native Laravel events

The reporter dispatches these events:

Operation Event
upload FileUploaded
edit/crop FileEdited
move FileMoved
copy FileCopied
rename FileRenamed
delete FileDeleted
create directory DirectoryCreated
rename directory DirectoryRenamed
delete directory DirectoryDeleted

File events contain the descriptor, SHA-256 checksum and authenticated user. Move and rename events contain both previous and file snapshots:

This allows audit and catalog synchronization without scanning the complete storage tree.

Correct order for destructive or relocating operations

Take the old snapshot before deleting, moving or renaming, then report only after the storage mutation succeeds:

For deletion:

Checksums are streamed instead of loading the whole file into memory. They can be changed or disabled:

Set an empty value to disable checksums.

Compatibility

The existing KCFINDER_URL_PREFIX and temporary_url_ttl configuration remain supported. Existing calls to select() and the previous two-argument KCFinderManager constructor continue to work. The automatic bridge requires KCFinder core 4.6 or newer.

The adapter keeps the HTTP bridge opt-in and never copies executable PHP files from vendor. Traditional standalone KCFinder installations remain supported.

Maintenance and community

This official KCFinder integration is maintained by KRMA together with its community of users and contributors. KRMA provides development, coordination and infrastructure to support the project's continuity.

Development


All versions of kcfinder-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
krma-cl/kcfinder Version ^4.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package krma-cl/kcfinder-laravel contains the following files

Loading the files please wait ...