PHPackages                             unisharp/laravel-datacarrier - 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. [Templating &amp; Views](/categories/templating)
4. /
5. unisharp/laravel-datacarrier

ActiveLibrary[Templating &amp; Views](/categories/templating)

unisharp/laravel-datacarrier
============================

Handle data and let it live in global scope

1.0.4(9y ago)17571MITPHPPHP &gt;=5.4.0

Since Oct 16Pushed 9y ago5 watchersCompare

[ Source](https://github.com/UniSharp/laravel-datacarrier)[ Packagist](https://packagist.org/packages/unisharp/laravel-datacarrier)[ RSS](/packages/unisharp-laravel-datacarrier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

Laravel Data Carrier
--------------------

[](#laravel-data-carrier)

[![Build Status](https://camo.githubusercontent.com/8c1bea304ed39eb880696e15d06ed7c8f6ee3063f6a69def8f96da22bb093d37/68747470733a2f2f7472617669732d63692e6f72672f556e6953686172702f6c61726176656c2d64617461636172726965722e737667)](https://travis-ci.org/UniSharp/laravel-datacarrier)[![Version](https://camo.githubusercontent.com/35306567af5dd510be600e68c3bfa1528b2c1583624941b8ea8f4a126eb3c539/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756e6973686172702f6c61726176656c2d64617461636172726965722e737667)](https://packagist.org/packages/unisharp/laravel-datacarrier)[![License](https://camo.githubusercontent.com/ebcfb04496a05f8621c77c476ed0a2f61587c5eed873c270a7dfe364373a7237/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f756e6973686172702f6c61726176656c2d64617461636172726965722e737667)](https://packagist.org/packages/unisharp/laravel-datacarrier)[![Total Downloads](https://camo.githubusercontent.com/3cacd7408b2d7d9a00c51b24354d411177376fcdeb9ac7399ff29e67fcdf02ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756e6973686172702f6c61726176656c2d64617461636172726965722e737667)](https://packagist.org/packages/unisharp/laravel-datacarrier)

### Introduction

[](#introduction)

Provide an object as Facade to put all global variables togetther, clean your code. Normally we use it to passing variables from Controller to View.

And you can extend your formating method to help you format global data

### Install Data Carrier

[](#install-data-carrier)

composer.json:

```
"require" : {
    "unisharp/laravel-datacarrier" : "~1.0"
},
"repositories": {
    "type": "git",
    "url": "https://github.com/UniSharp/laravel-datacarrier.git
}

```

save it and then

```
composer update

```

### Set ServiceProvider and Set Facade

[](#set-serviceprovider-and-set-facade)

#### in config/app.php:

[](#in-configappphp)

- ServiceProfider

    ```
      Unisharp\DataCarrier\DataCarrierServiceProvider::class,

    ```
- alias

    ```
      'DataCarrier' => Unisharp\DataCarrier\DataCarrierFacade::class,

    ```

### Usage

[](#usage)

- get and set global data

    you can use Facade to set and get items

    ```
      \DataCarrier::set('key', 1); // ['a' => 1]

      \DataCarrier::get('key'); // 1

      // you can set a default value for get method

      \DataCarrier::get('key', 0); // if you cannot get it, it will return 0

      $var = d('key', 0); // Quick access by d() helper.

      \DataCarrier::all(); // it will get an array with all items

    ```

    you can also use dot to seperate array

    ```
      # [
      #    'a' => [
      #        'b' => 'value'
      #    ]
      # ]

      \DataCarrier::get('a.b'); // 'value'

    ```
- customize your format method (Add method into Data Carrier)

    ```
      \DataCarrier::extend('format', function ($data) {
          return number_format($data);
      })

    ```
- format your data

    ```
      # ['num' => '100000']
      \DataCarrier::format('num') // 100,000

    ```

### Helper can use helper to set, get your data

[](#helper-can-use-helper-to-set-get-your-data)

- get, set function

    ```
      carrier_set('num', 1); // ['a' => 1]
      carrier_get('num'); // 1

    ```
- use carrier() to muniplate container

    ```
      carrier() // it's just return App::make('DataCarrier')

    ```

### Another way to work with DataCarier

[](#another-way-to-work-with-datacarier)

- get, set can replace by it

    ```
       carrier('num')->get();
       carrier('num')->set(5);

    ```
- extend your formating method

    ```
      carrier()->extend('format', function ($data) {
          return number_format($data);
      })

    ```
- use your formatting method

    ```
      carrier('num')->format(); // it will return formating result

    ```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~64 days

Total

6

Last Release

3611d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5.0

1.0.1PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1203922?v=4)[FreedomKnight](/maintainers/FreedomKnight)[@FreedomKnight](https://github.com/FreedomKnight)

![](https://www.gravatar.com/avatar/49773ea5050ec1d004a506cc1e11be08d6e87339120b5d223b8921e3f671153c?d=identicon)[g0110280](/maintainers/g0110280)

![](https://avatars.githubusercontent.com/u/181350?v=4)[Youchen Lee (isacl)](/maintainers/youchenlee)[@youchenlee](https://github.com/youchenlee)

---

Top Contributors

[![youchenlee](https://avatars.githubusercontent.com/u/181350?v=4)](https://github.com/youchenlee "youchenlee (12 commits)")[![FreedomKnight](https://avatars.githubusercontent.com/u/1203922?v=4)](https://github.com/FreedomKnight "FreedomKnight (6 commits)")

---

Tags

apilaraveldataview

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unisharp-laravel-datacarrier/health.svg)

```
[![Health](https://phpackages.com/badges/unisharp-laravel-datacarrier/health.svg)](https://phpackages.com/packages/unisharp-laravel-datacarrier)
```

###  Alternatives

[infyomlabs/generator-builder

InfyOm Laravel Generator GUI Builder

132435.7k](/packages/infyomlabs-generator-builder)[guilhermegonzaga/presenter

Implementation for Laravel of the presenter design pattern.

47242.1k](/packages/guilhermegonzaga-presenter)[torann/device-view

Provides support for device based view layouts in Laravel.

146.6k](/packages/torann-device-view)[delatbabel/viewpages

Support rendering/view of Laravel pages and templates from a database.

121.4k](/packages/delatbabel-viewpages)

PHPackages © 2026

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