Download the PHP package avto-dev/back2front-laravel without Composer

On this page you can find all versions of the php package avto-dev/back2front-laravel. 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 back2front-laravel

Laravel

Send backend data to frontend for Laravel applications

Version PHP Version Build Status Coverage Downloads count 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

Require this package with composer using the following command:

Installed composer is required (how to install composer).

You need to fix the major version of package.

For publish config and assets execute in console next command:

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

At backend

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

or getting object from service container:

Methods

Back2Front object provides the following public methods:

Method Description
put($key, $value) Set variable in stack. Parameter key must be a string
get($key, [default]): mixed Get value by key
has($key): bool Check that key exists in storage
forget($key) Remove item from storage
toArray(): array Return data in array
toJson(): string Return data in JSON encoded

Also you can iterate object.

Back2Front supports dot notation in put, get, has and forget methods.

At frontend will object:

At frontend

For output data at frontend you should add following code in your blade-template (preferably in the section head of the resulting HTML document):

Or by blade-directive

It creates property with name equals DATA_PROPERTY_NAME for superg lobal object window with early added data.

Default value of DATA_PROPERTY_NAME is 'backend'. If you use custom value and want to use front-stack helper on frontend, than you need call window.frontStack.setStackName('custom_name'); before helper usage.

Package contains javaScript helper for access to data object.

Use it you may adding js file at page:

You also can use it as require.js dependency.

This creates window.frontStack object which provides following methods:

Method Description
get(key, [default]) Get value by key. Supports "dot" notation for access to items if in data contains multidimensional arrays. Returns undefined if item don't exists or default value if it set
has(key): bool Check that key exists in storage
all(): object Returns data object

Example

At backend:

At frontend:

Testing

For package testing we use phpunit framework and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:

For testing JavaScript code using Mocha and Chai framework.

Run in console npm test. Coverage report will in coverage/coverage.json and in coverage/lcov-report/index.html for humans.

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.


All versions of back2front-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-mbstring Version *
ext-json Version *
illuminate/support Version ^10.0 || ^11.0
illuminate/view Version ^10.0 || ^11.0
illuminate/container Version ^10.0 || ^11.0
illuminate/config Version ^10.0 || ^11.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 avto-dev/back2front-laravel contains the following files

Loading the files please wait ....