Download the PHP package peyman3d/laravel-share without Composer

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

Laravel Share

Laravel Share is an easy way to share any data through a request.

Introduction

With Laravel Share you can share any data through a request to use later. You should consider it as an array that are available everywhere. I mean EVERYWHERE! From Service Provider to routes, middlewares, controllers and views.

Installation

Install using Composer

When installation completes you should add provider and alias to config/app.php file. If you are using Laravel 5.5 or 5.6 you can skip this step as Laravel can discover this package automatically.

Usage

Using Laravel Share is easy as pie. Just think of a person and you can share data like this:

And when you want that data just use Share::get('Person');;

As you see you can create an item with make() method. then you can add parameters to it by using add($key, $value) or edit($key, $value). You can also use share() helper instead of Share Facade.

There are some basic methods for working with data array:

What data can be shared?

Almost anything. You can share any string, numbers, objects and closures.

Even better helpers

Laravel Share has more helpers to create better syntax. You can use any combination of these helpers.

As you can see title() method accept a value and work just like add('title', 'Senior Developer').

Check all helpers here:

Other than this helpers for parameters, we also have some helpers for sections and types:

You can check some examples:

Custom helpers

I added some basic helpers that works for me, but you can also add yours. You can remove or edit items too. See some examples below:

Just an example

Imagine you have an admin panel that has a menu on sidebar. This menu has multiple items and each one may have sub-items. Now, we add some items to the menu:

These codes can be anywhere: Service Provider, routes, middlewares, controller, model and even a blade view. If you want you can active a menu item like this:

And you can sort items with order() method. It can be done when you add an item or just any other times and places.

If you don't set order, it counts as 100.

And finally you can use this data in a blade view like sidebar.blade.php as simple as this:

And that's just it :) Just one thing. I use a helper function called make_menu_link() that I wrote for create item link base on what it has. It's not on the package as it may not be useful for you. But you can have it in this link.


All versions of laravel-share with dependencies

PHP Build Version
Package Version
No informations.
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 peyman3d/laravel-share contains the following files

Loading the files please wait ....