PHPackages                             ibrostudio/laravel-file-data-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. ibrostudio/laravel-file-data-manager

ActiveLibrary[File &amp; Storage](/categories/file-storage)

ibrostudio/laravel-file-data-manager
====================================

Laravel package to manage files data

1.1.0(11mo ago)08[3 PRs](https://github.com/iBroStudio/laravel-file-data-manager/pulls)MITPHPPHP ^8.2

Since Jun 19Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/iBroStudio/laravel-file-data-manager)[ Packagist](https://packagist.org/packages/ibrostudio/laravel-file-data-manager)[ Docs](https://github.com/ibrostudio/laravel-file-data-manager)[ RSS](/packages/ibrostudio-laravel-file-data-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (6)Used By (0)

Laravel package to manage files data
====================================

[](#laravel-package-to-manage-files-data)

[![Latest Version on Packagist](https://camo.githubusercontent.com/831382ad475293a11ea336284a2040affb2a6d80851fed39156df5eb4330594d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6962726f73747564696f2f6c61726176656c2d66696c652d646174612d6d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ibrostudio/laravel-file-data-manager)[![GitHub Tests Action Status](https://camo.githubusercontent.com/53f88cdf121e27eb3f5c5bb65d15b22c6176c3a5ef2b690414f2d0b4e877de10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6962726f73747564696f2f6c61726176656c2d66696c652d646174612d6d616e616765722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/ibrostudio/laravel-file-data-manager/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/bbc4bc5d3e6ef3bea597139a5dfd9b446e599d0ba4ddff69afce47eb37d90ef0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6962726f73747564696f2f6c61726176656c2d66696c652d646174612d6d616e616765722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/ibrostudio/laravel-file-data-manager/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)

Little tool to read, change or add data in files.

Currently, it works with:

- .json files
- .php files
- .js files

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ibrostudio/laravel-file-data-manager
```

Usage
-----

[](#usage)

There is 3 types of chainable methods, callable in this order: load &gt; manipulation &gt; result

1. Load

- load(string $file)

2. Manipulation

- findValue(string $key)
- findArray(string $key)
- findRegex(string $regex)
- replaceValue(string $key, mixed $value)
- addArrayValue(string $key, mixed $value)
- addRegexValue(string $regex, string $value)

3. Result

- getContent()
- getValue()
- write()

#### Examples

[](#examples)

- Working with values

```
use IBroStudio\FileDataManager\FileDataManager;

$package_name = FileDataManager::load(base_path('composer.json'))
    ->findValue('name')
    ->getValue(); // = 'vendor/currentPackageName'

$package_name = FileDataManager::load(__DIR__ . '/Fixtures/Test.php')
    ->replaceValue('name', 'vendor/newPackageName')
    ->findValue('name')
    ->getValue(); // = 'vendor/newPackageName'
```

- Working with arrays

Test.php

```
class Test
{
    protected array $testArray = [
        SomeClass1::class,
        SomeClass2::class,
    ];
}
```

```
use IBroStudio\FileDataManager\FileDataManager;

$test = FileDataManager::load('Test.php');

$test
    ->findArray('$testArray')
    ->getValue(); // = ['SomeClass1::class', 'SomeClass2::class']

$test
    ->addArrayValue('$testArray', 'SomeClass3::class')
    ->write();

$test
    ->findArray('$testArray')
    ->getValue(); // = ['SomeClass1::class', 'SomeClass2::class', 'SomeClass3::class']
```

- Working with regex

Test.php

```
use Vendor\Package\Namespace\Class1;

class Test{}
```

```
use IBroStudio\FileDataManager\FileDataManager;

FileDataManager::load('Test.php')
    ->addRegexValue('#(use\s(.*?)\;)#s', 'use Vendor\Package\Namespace\Class2;')
    ->write();

$imports = FileDataManager::load('Test.php')
    ->findRegex('#(use\s(.*?)\;)#s')
    ->getValue(); // = ['use Vendor\Package\Namespace\Class1;', 'use Vendor\Package\Namespace\Class2;']
```

It is possible to chain manipulations methods:

```
use IBroStudio\FileDataManager\FileDataManager;

FileDataManager::load('Test.php')
    ->replaceValue('$testValue', 'tata')
    ->addArrayValue('$testArray1', "'NewValue'")
    ->addArrayValue('$testArray2', 'OtherNewValue::class')
    ->addRegexValue('#(use\s(.*?)\;)#s', 'use Vendor\Package\Namespace\Class2;')
    ->write();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [iBroStudio](https://github.com/iBroStudio)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance50

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1072 days

Total

2

Last Release

349d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

1.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a456dae716df4be38cb7d5f02ca522a02ec37eda586ab0cae0f504516b7c1ef?d=identicon)[iBroStudio](/maintainers/iBroStudio)

---

Top Contributors

[![Yann-iBroStudio](https://avatars.githubusercontent.com/u/2676572?v=4)](https://github.com/Yann-iBroStudio "Yann-iBroStudio (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ibrostudio-laravel-file-data-manager/health.svg)

```
[![Health](https://phpackages.com/badges/ibrostudio-laravel-file-data-manager/health.svg)](https://phpackages.com/packages/ibrostudio-laravel-file-data-manager)
```

###  Alternatives

[spatie/livewire-filepond

Upload files using Filepond in Livewire components

306452.7k3](/packages/spatie-livewire-filepond)[elegantly/laravel-invoices

Store invoices safely in your Laravel application

23131.8k](/packages/elegantly-laravel-invoices)[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[kalynasolutions/laravel-tus

Laravel package for handling resumable file uploads with tus protocol and native Uppy.js support without additional tus servers

5261.8k1](/packages/kalynasolutions-laravel-tus)[codebar-ag/laravel-flysystem-cloudinary

Cloudinary Flysystem v1 integration with Laravel

1224.9k2](/packages/codebar-ag-laravel-flysystem-cloudinary)[mreduar/s3m

Multipart Uploads using Laravel and AWS S3

173.6k](/packages/mreduar-s3m)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
