PHPackages                             avto-dev/back2front-laravel - 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. [API Development](/categories/api)
4. /
5. avto-dev/back2front-laravel

ActiveLibrary[API Development](/categories/api)

avto-dev/back2front-laravel
===========================

Laravel package for sending data from backend to frontend over JavaScript object

v2.9.0(1y ago)712.0k7MITPHPPHP ^8.2CI failing

Since Oct 12Pushed 1y ago5 watchersCompare

[ Source](https://github.com/avto-dev/back2front-laravel)[ Packagist](https://packagist.org/packages/avto-dev/back2front-laravel)[ RSS](/packages/avto-dev-back2front-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (8)Versions (16)Used By (0)

 [![Laravel](https://camo.githubusercontent.com/640c3d52b2764f179ef3cf089b604516a8c4ac0a06f055a46c6a7fce9428b787/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667)](https://camo.githubusercontent.com/640c3d52b2764f179ef3cf089b604516a8c4ac0a06f055a46c6a7fce9428b787/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667)

Send backend data to frontend for Laravel applications
======================================================

[](#send-backend-data-to-frontend-for-laravel-applications)

[![Version](https://camo.githubusercontent.com/6853968b4a6a45e04f80264655dcb07b73f85a84ed6f8ffa183c2f4267431c6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/back2front-laravel)[![PHP Version](https://camo.githubusercontent.com/9f7ba13aae0f65a4003ffdbb3f11495db9652bd698bbcec8f61ed26230dd0df2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://packagist.org/packages/avto-dev/back2front-laravel)[![Build Status](https://camo.githubusercontent.com/689b29b97b566162a5c10b14e7c34e517d23c625be439e3ab12e3357791a183d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2f74657374732e796d6c)](https://github.com/avto-dev/back2front-laravel/actions)[![Coverage](https://camo.githubusercontent.com/dd101da092acf7fa5ff990d6a1b46a5a12451b7f0bd5e795a61b6e7533cf5714/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2f6d61737465722e7376673f6d61784167653d3630)](https://codecov.io/gh/avto-dev/back2front-laravel/)[![Downloads count](https://camo.githubusercontent.com/d8cea8b80a6973e96e608f68121436b9a877a3eb2480b681d5069985659c4738/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/back2front-laravel)[![License](https://camo.githubusercontent.com/b20092fd08985fed22f56bd956db40a614a9c00c4b54daa17ad57951456a88b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6176746f2d6465762f6261636b3266726f6e742d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://github.com/avto-dev/back2front-laravel/blob/master/LICENSE)

Package for sending data from backend to frontend JS variable.

Package a repository of the form `"key" => "value"` and methods for converting data to array and JSON.

Install
-------

[](#install)

Require this package with composer using the following command:

```
$ composer require avto-dev/back2front-laravel "^2.0"
```

> Installed `composer` is required ([how to install composer](https://getcomposer.org/download/)).

> You need to fix the major version of package.

For publish config and assets execute in console next command:

```
$ php artisan vendor:publish --provider="AvtoDev\\Back2Front\\ServiceProvider" --force
```

This command will publish files `./config/back-to-front.php` with basic setting for package and `public/vendor/back-to-front/front-stack.js` with JavaScript object for getting access to the data.

Usage
-----

[](#usage)

### At backend

[](#at-backend)

To get the stack object at backend you can use global helper:

```
