承接 shaka/dynamic-update-trait 相关项目开发

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

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

shaka/dynamic-update-trait

最新稳定版本:v1.0.1

Composer 安装命令:

composer require shaka/dynamic-update-trait

包简介

The Dynamic Update Trait for Laravel provides a convenient way to dynamically update model attributes using magic methods. This trait allows you to update individual model attributes without explicitly defining setter methods for each attribute. It simplifies the process of updating model fields by

README 文档

README

The Dynamic Update Trait for Laravel provides a convenient way to dynamically update model attributes using magic methods. This trait allows you to update individual model attributes without explicitly defining setter methods for each attribute. It simplifies the process of updating model fields by providing a generic update method that can be called with dynamic method names.

Installation

You can install the package via Composer:

composer require shaka/dynamic-update-trait

Usage

To use the Dynamic Update Trait, simply use it in your Eloquent model:

<?php
 
namespace App\Models;
 
use Illuminate\Database\Eloquent\Model;
use Shaka\DynamicUpdateTrait\Traits\DynamicUpdateTrait;


class User extends Model
{
  use DynamicUpdateTrait;
}

You can then update model attributes dynamically:

$model = User::find(1);
$model->updateName('Shah Sawood'); // name field will be updated 
$model->updateEmail('shahsawoodshinwari@gmail.com'); // email field will be updated

Additional Information

The package expects the fields to be updated are in snake_case.

Contributing

Contributions are welcome! Feel free to submit pull requests or open issues to improve the package.

License

The Dynamic Update Trait for Laravel is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固