Download the PHP package arjanwestdorp/exposable without Composer

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

Laravel exposable

Latest Stable Version License Build Status Quality Score Coverage StyleCI

This is a package to expose your protected models in a secure way. You maybe also ran into the problem that you have a file stored in a secure location and you only want to expose it to your users when they are logged in or payed for it. Laravel exposable will make this much easier for you now.

Version Compatibility

Laravel Exposable
5.3 1.0.x
5.4 1.1.x

Installation

The recommended way to install Exposable is through composer:

Next, you'll have to add the service provider to your config/app.php

Now you'll need to publish the config file:

Usage

Add the Exposable trait to the model(s) you want to expose:

Next, you will need to implement the expose method on your model:

Finally you'll need to add the model to the config file config/exposable.php and bind it to a key:

Now your model is ready to expose. Simply use the exposeUrl method to get the url on which the model will be available.

Configuration

Configuration is mainly done through the config file. Although there is the option to deviate on model level.

Config file

Below an explanation of all options in the config file.

key

The key which is used to sign the expose urls. By default it uses the Laravel key of you application.

url-prefix

The prefix of the url on which the models will be exposed.

When exposing the complete url would look like:

middleware

Here you can define middleware of your application you want to include for the expose url.

lifetime

The time after which the url expires. When an integer is given the time is in minutes. Any valid date modification can be used like 2 hours, 1 day. See http://php.net/manual/en/datetime.formats.relative.php for all allowed formats.

exposables

Array containing all the models you want to expose. The key is used in the url to retrieve the corresponding model.

guards

Array of guards which can protect the exposables. These are NOT the same as the Laravel guards. A custom guard can be very usefull when you want to expose a model only to authenticated users that have payed for the content for example. See Custom guards for an example.

default-guard

The default guard that is used to check if the model can be exposed. You can override this settings on the exposable model if needed. Set to null if you don't want a guard check. That only works when the require-guard is set to false.

require-guard

Define if a guard is always required when exposing a model. Settings this to false will give you the option to use no guard by setting the default-guard option to null or $exposableGuard on a model.

Model configuration

On a model you can override the default lifetime and the guard which are used to expose:

Custom guards

You can define your own custom guards which will be checked when accessing the expose url. These guards will need to implement the ArjanWestdorp\Exposable\Guards\Guard interface. An example of using a custom guard can be when checking if a user is not only authenticated, but also a member:

Define this guard in the config/exposable.php config file:

Now you're good to go and set either the default-guard => 'member' in your config file or set the protected $exposableGuard = 'member' on your model.

Changelog

Please see CHANGELOG for more information about what has changed recently.

Security

If you discover any security issues, please email [email protected] instead of creating an issue.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of exposable with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.13
illuminate/support Version ^5.4 || ^6.0
league/uri Version ^5.3
nesbot/carbon Version ^1.22 || ^2.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 arjanwestdorp/exposable contains the following files

Loading the files please wait ....