承接 marmarait/laravel-dynamic-attributes 相关项目开发

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

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

marmarait/laravel-dynamic-attributes

Composer 安装命令:

composer require marmarait/laravel-dynamic-attributes

包简介

Adds Dynamic Attributes to your Models

README 文档

README

Overview

Add Additional Fields to your Models with a key value table

Install

composer require marmarait/laravel-dynamic-attributes

Usage

  • add the Trait "HasDynamicAttributes" to your model

  • in the method "getDynamicAttributes" return an array with the dynamic attributes and their field types. Available are:

    • string
    • text
    • int
    • double
    • object
    • date
    • time
    • datetime
  • Use it as you normally would with static attributes.

Example: If you want your Users Model to have an additional field named "country" with type string: Add HasDynamicAttributes to your User model Make the getDynamicAttributes method return ['country'=>'string']

Set the field by assigning the property to the model:

$user->country='Austria';

Retrieving the Property is about the same:

echo $user->country; // 'Austria'

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固