PHPackages                             isaacongoma/jsonwriter - 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. isaacongoma/jsonwriter

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

isaacongoma/jsonwriter
======================

Reads and Writes PHP array or Laravel Collection to JSON file

07PHP

Since Jun 14Pushed 3y agoCompare

[ Source](https://github.com/isaacongoma/JsonWriter)[ Packagist](https://packagist.org/packages/isaacongoma/jsonwriter)[ RSS](/packages/isaacongoma-jsonwriter/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Write PHP array to json File
============================

[](#write-php-array-to-json-file)

[![Latest Stable Version](https://camo.githubusercontent.com/b6094967f4d392857163392b65edd80924609e9ef5ae0ce3288537a14854ec8e/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![Total Downloads](https://camo.githubusercontent.com/c31ab99d79053a8e1f891da08c09a3b1daafe73c0148b816907579ac9465281c/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![Latest Unstable Version](https://camo.githubusercontent.com/165780e0903bdd5e7296b6891ba5e55a0add8c711e15680e860d6df10f2a78be/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![License](https://camo.githubusercontent.com/e2150830e16a74c3e9e0f765a768cecebb7ebe3aa844b117829c6782259684af/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![Monthly Downloads](https://camo.githubusercontent.com/ca2e42d79481d2341d150ac40ab95db991918ea3251bbe8c877c2e55c6b9c1e3/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f642f6d6f6e74686c793f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![Daily Downloads](https://camo.githubusercontent.com/56781118b73ddca2a416ecfe846b9132f79ba72b6e8294d47db4f46df10d232f/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a6b6972616e2f6a736f6e7772697465722f642f6461696c793f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/manojkiran/jsonwriter)[![Laravel5.8](https://camo.githubusercontent.com/99229b8fb20560b0ac7bc61beab4fa998bbe9ef517ae102a2f5701b46a3d5453/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d4672616d65776f726b2d7265642e7376673f7374796c653d666c61742d737175617265)](https://www.laravel.com/)

Read and write PHP array| Laravel Collection | EloquentCollection to json file

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

[](#installation)

You can install the package via composer:

```
composer require manojkiran/jsonwriter
```

Import
------

[](#import)

```
use Manojkiran\JsonWriter\Facades\JsonWriter;
```

Usage
-----

[](#usage)

Writing
=======

[](#writing)

Writing the Content to Json
---------------------------

[](#writing-the-content-to-json)

```
    //get the List of Active users
    $usersList      = User::where('status','=','Active')->get();
    //getting the path where the file is available
    $jsonFilePath   = storage_path('jsonWriter.json');
    //loading the Json File and Writing the Content to it
    $writeToJson    = JsonWriter::load( $jsonFilePath)
                        ->write($usersList);
```

Writing the Content to Json(Force)
----------------------------------

[](#writing-the-content-to-jsonforce)

```
//by default the duplicate Content Will Not to Writtent To Json File(To Reduce the data Size)

    //array of the Projects by Taylor Otwell
    $laravel = ['name' => 'Taylor Otwell','developed' => ['Laravel','Lumen','Telescope','Nova']];
    //getting the path where the file is available
    $jsonFilePath   = storage_path('jsonWriter.json');
    //loading the Json File and Writing the Content to it
    $writeToJson    = JsonWriter::load( $jsonFilePath)
                        ->write($laravel,true);
```

Reading
=======

[](#reading)

```
    //get the List of Active users
    $usersList      = User::where('status','=','Active')->get();
    //getting the path where the file is available
    $jsonFilePath   = storage_path('jsonWriter.json');
    //loading the Json File and Writing the Content to it
    $writeToJson    = JsonWriter::load( $jsonFilePath)
                        ->parseFile();
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Manojkiran](https://github.com/manojkiran)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ffe219fcd3d38abd6f400d8d7db0485761fb6c5f003548aa8bdbe9c6de2c253?d=identicon)[isaacongoma](/maintainers/isaacongoma)

---

Top Contributors

[![ManojKiranA](https://avatars.githubusercontent.com/u/30294553?v=4)](https://github.com/ManojKiranA "ManojKiranA (11 commits)")[![isaacongoma](https://avatars.githubusercontent.com/u/21239787?v=4)](https://github.com/isaacongoma "isaacongoma (3 commits)")

### Embed Badge

![Health badge](/badges/isaacongoma-jsonwriter/health.svg)

```
[![Health](https://phpackages.com/badges/isaacongoma-jsonwriter/health.svg)](https://phpackages.com/packages/isaacongoma-jsonwriter)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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