Download the PHP package codebar-ag/laravel-m-files without Composer

On this page you can find all versions of the php package codebar-ag/laravel-m-files. 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 laravel-m-files

Laravel M-Files banner with description and logo

Latest Version on Packagist GitHub-Tests GitHub Code Style Larastan Total Downloads

Laravel M-Files Integration

A Laravel package providing DTOs and requests for integrating with M-Files REST API.

Installation

You can install the package via composer:

Requirements

PHP and Laravel compatibility

Package release PHP (Composer constraint) Laravel
v13.x 8.3.*\|8.4.*\|8.5.* ^13.0
v12.x 8.2.*\|8.3.*\|8.4.* ^12.0

Install a package version whose row matches your application’s PHP and Laravel versions. The current major release is v13.x (see Packagist for the exact tag).

Configuration

Publish the configuration file:

Add your M-Files authentication credentials to your .env file:

Configuration Options

The package supports the following configuration options:

Transport Options

The m-files.http config block controls timeouts and retries:

Without the timeouts Guzzle waits indefinitely, so a single unresponsive vault can pin every PHP worker in the pool.

Retries are deliberately conservative — only failures that are safe to replay are retried: connection errors, 408, 429, 503, and 5xx only on idempotent methods (GET, HEAD, OPTIONS). A document-creating POST is never sent twice. On a 401 the cached authentication token is dropped and re-fetched automatically, which covers a vault that expired or restarted the session before the cache TTL lapsed; genuinely bad credentials still fail fast. Set M_FILES_TRIES to 1 to disable retries entirely.

Authentication

The package provides automatic authentication token management with caching support.

M-Files Connector

How the connector authenticates

Authentication is handled automatically by the MFilesConnector. When you create a connector instance with your credentials, it will automatically:

  1. Cache authentication tokens - Tokens are cached for M_FILES_EXPIRATION_SECONDS / config('m-files.auth.expiration') (default 3600 seconds), or the tokenTtlSeconds argument on ConfigWithCredentials
  2. Include authentication headers - The X-Authentication header is automatically added to all requests
  3. Handle token refresh - When the cache entry expires, a new token is obtained on the next request

You can optionally inject a CacheKeyManager for tests or custom cache wiring: new MFilesConnector(configuration: $config, cacheKeyManager: $manager).

Cache and production security

Requests

Authentication Requests

LogInToVaultRequest

Gets an authentication token using username/password credentials.

Constructor Parameters:

Request:

Response:

File Requests

UploadFileRequest

Uploads a file to M-Files.

Constructor Parameters:

Request:

Response:

CreateSingleFileDocumentRequest

Creates a single file document in M-Files.

Constructor Parameters:

Request:

Both shapes are accepted for files: a single upload-info array (files: $uploadedFile) and a list of them (files: [$uploadedFile]). Passing several entries creates a multi-file document:

Response:

With Custom Property Values:

DownloadFileRequest

Downloads a file from M-Files.

Constructor Parameters:

Request:

Response:

Property Requests

GetObjectInformationRequest

Retrieves object information and properties from M-Files.

Constructor Parameters:

Request:

Response:

SetPropertiesRequest

Sets properties for an existing object in M-Files.

Constructor Parameters:

Request:

Response:

Error Handling

Every failure surfaces as a single exception, CodebarAg\MFiles\Exceptions\MFilesErrorException — including responses that are not JSON at all (an HTML error page from a reverse proxy or gateway, which previously escaped as a JsonException).

DTOs

Configuration DTOs

ConfigWithCredentials

Represents M-Files configuration with authentication credentials.

Properties:

Methods:

Usage:

File DTOs

File

Represents a file in M-Files.

Properties:

Methods:

Usage:

DownloadedFile

Represents a downloaded file with content and metadata.

Properties:

Methods:

Usage:

Property DTOs

SetProperty

Represents a property value for creating documents.

Properties:

Methods:

Usage:

GetProperty

Represents a property retrieved from M-Files.

Properties:

Methods:

Usage:

ObjectProperties

Represents object properties in M-Files.

Properties:

Methods:

Usage:

Enums

MFDataTypeEnum

Represents data types in M-Files.

Available Values:

Usage:

Testing

composer test runs Pest with --no-coverage so the suite passes without PCOV or Xdebug (PHPUnit is configured with failOnWarning="true", and missing a coverage driver would otherwise fail the run).

Static analysis:

To generate a coverage report locally, install and enable PCOV or Xdebug, then run:

On GitHub Actions, the run-tests workflow runs the matrix with --no-coverage and includes a coverage job (PHP 8.5 + PCOV) that writes Clover output and uploads it as a workflow artifact.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Open a pull request or issue on GitHub. Please run composer test and composer analyse before submitting.

Security

Operational notes on caching and credentials are described under Cache and production security.

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-m-files with dependencies

PHP Build Version
Package Version
Requires php Version 8.3.*|8.4.*|8.5.*
guzzlehttp/guzzle Version ^7.9.2
illuminate/contracts Version ^13.0
illuminate/support Version ^13.0
saloonphp/cache-plugin Version ^3.1
saloonphp/laravel-plugin Version ^4.0
saloonphp/saloon Version ^4.0
spatie/laravel-package-tools Version ^1.19.0
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 codebar-ag/laravel-m-files contains the following files

Loading the files please wait ...