承接 danjamesmills/config-class-resolver 相关项目开发

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

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

danjamesmills/config-class-resolver

最新稳定版本:1.0.0

Composer 安装命令:

composer require danjamesmills/config-class-resolver

包简介

A Laravel package for resolving classes based on configuration

README 文档

README

A simple Laravel package for resolving classes based on configuration.

Installation

Install the package via Composer:

composer require danjamesmills/config-class-resolver

Usage

To resolve a class from the configuration, call the resolve_class_from_config function with the appropriate parameters:

resolve_class_from_config('your-package-name', 'class');

In the example above, 'your-package-name' represents the main configuration key, and 'class' represents the specific key within that configuration.

If the configuration exists and the class is found, the function will return the resolved class instance. If the class is not found, it will throw a ClassNotFoundException.

Example

Ensure that your configuration file ('config/calls.php') contains the necessary entries for the classes you want to resolve. Here's an example configuration file:

return [
    /*
     * Here you can specify which relationship(s) the call model has.
     */
    'associations' => [

        'contact' => [
            'field_key' => 'contact_ids',
            'class' => \DanJamesMills\CRM\Models\Contact::class,
            'relationship_name' => 'contacts',
        ],

        'company' => [
            'field_key' => 'company_ids',
            'class' => \DanJamesMills\CRM\Models\Company::class,
            'relationship_name' => 'companies',
        ],
    ]
]

In this example, 'your-package-name' represents the main configuration key. Make sure to replace '\App\Models\YourModel::class' with the appropriate class you want to resolve.

License

This package is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固