Download the PHP package taylornetwork/setting without Composer

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

Settings for Laravel User and App

This package provides an easy way to access settings for the current logged in user as well as global app settings.

NOTE: Some features have changed in v2

  1. Changes
  2. About
  3. Install
  4. Usage
    • Available Methods
    • Classes
    • Facades
    • Helper Functions
  5. HasSettings Trait
  6. Config
  7. Alternate Configuration
  8. Extending
  9. License

Changes

v2.1

v2.0

Support for app specific AND user specific settings has been added.

If you use the setting helper it will still work but will be removed, so use user_setting instead. The Setting facade has been renamed to UserSetting if you still have code with the Setting facade you can rename the alias in your config/app.php

About

This package uses Laravel's auth function to access the logged in user and return their setting for a given key, or a default value. Similar to the way that the config and env functions work.

When using the HasSettings trait it allows you to access a non-logged in user's settings.

By default if the default value is not set and a setting cannot be found, null is returned. The default value will also be returned if there is no logged in user.

It also includes support for app specific settings via AppSetting

Install

Via Composer

Run database migrations


You can optionally add the HasSettings trait to your user model to access settings directly.

Usage

Note: the UserSetting and AppSetting classes extend Illuminate\Database\Eloquent\Model

Available Methods

All of these methods are available when using the class or facade.

guard($guard) [UserSetting only]

This will allow you to manually set an auth guard before trying to find an active user.

get($key, $default = null) [UserSetting and AppSetting]

Get a setting for the app/logged in user or return the default value.

set($key, $value) [UserSetting and AppSetting]

Creates or updates the setting for the logged in user or app.

Classes

UserSetting:

AppSetting:

Facades

UserSetting:

AppSetting:

Helpers

The user_setting and app_setting helper functions are aliases for the get method. The user_setting helper has an optional third parameter to pass a guard or guards.

Example:

HasSettings Trait

The HasSettings trait adds a settings relation and the following methods to your model

setting($key, $default = null)

This is the same as the get method above BUT can be used for any user not just one that is logged in.

updateSetting($key, $value)

This will create or update a setting for the specified user.

Config

If you need to change the default auth guard or user model, publish config.

Alternate Configuration

You can modify the settings table to suit your needs, publish the migrations

Be sure to update the config with appropriate related_column if you change it.

Extending

You can extend the UserSetting and AppSetting models if you need additional functionality.

Be sure to update the config with the appropriate new user_setting_model or app_setting_model.

License

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


All versions of setting with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
illuminate/support Version >=5.5
illuminate/auth Version >=5.5
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 taylornetwork/setting contains the following files

Loading the files please wait ....