priblo/laravel-has-attributes 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

priblo/laravel-has-attributes

Composer 安装命令:

composer require priblo/laravel-has-attributes

包简介

EAV based attributes as a Trait

README 文档

README

EAV Attributes in an handy Trait

Build Status Codacy Badge

This package provides a trait to attach attributes to any Eloquent model. The common use case is to add Settings to a model.

Attributes are stored following the Entity-Attribute-Value model. Data is abstracted using the Decorator pattern.

Install

Requires: Laravel >=5.4

Composer

    composer require priblo/laravel-has-attributes

Laravel

This package supports Auto Discovery. If your Laravel version doesn't support it or you have disabled it, you can install this package by adding to the 'providers' array in ./config/app.php

Priblo\LaravelHasAttributes\LaravelServiceProvider::class,

Then run:

php artisan vendor:publish --provider="Priblo\LaravelHasAttributes\LaravelServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Priblo\LaravelHasAttributes\LaravelServiceProvider" --tag="config"

Then migrate:

php artisan migrate

Cache

Caching requires a driver which supports tags. File and Database won't work, redis is suggested. Please make sure to either disable caching in the config or use the array driver for local development.

In the has-settings.php config file you can enable/disable caching and set the cache expiration time.

Caching is enabled by default

Notes

Please do remember that each of the settings in a EAV model are set in a TEXT field, thus a value of true will be stored as "1"

Roadmap

  • More tests
  • Expand README.MD

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固