承接 mrmmg/laravel_variables 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mrmmg/laravel_variables

最新稳定版本:v1.1.1

Composer 安装命令:

composer require mrmmg/laravel_variables

包简介

Moderate your variables with easy api like Drupal

README 文档

README

I have worked with both Drupal and Laravel frameworks. In Drupal, we have two helper functions known as variable_set and variable_get, whose job is to manage and store the variables that we intend to have in a permanent space (database). In Laravel, such a possibility is possible through .env file and config files, but we do not have any specific programming interface (API) to store such data in a database. Therefore, I have developed this Laravel package based on Drupal.

Note that in this package all variables stored in a global php variable when booting service providers only with one database query!

Installation

  1. First Install the latest package version

    compoer require mrmmg/laravel_variables

  2. Run Migrations

    php artisan migrate

Usage

Set Variable

With variable_set(name, value) helper function you can store variables in database. Example:

variable_set("prune_cache", true);
variable_set("dataset", [...]);

You can store any type of value, something like Objects, Class References and etc.

Get Variable

Use variable_get(name, default = null) helper function. Example:

$dataset = variable_get("dataset", []);

//$dataset will be a array if found otherwise an empty array (default value) will be returned.

Delete Variable

If you wants to delete a variable permanently from database use variable_del(name) helper function. Example:

variable_del("dataset");

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-19