Download the PHP package weijukeji/laravel-dictionary without Composer

On this page you can find all versions of the php package weijukeji/laravel-dictionary. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-dictionary

Laravel Dictionary

Latest Version on Packagist Total Downloads License

一个功能完整、易于使用的 Laravel 字典管理包,支持分类和字典项的统一管理,内置缓存优化,提供 RESTful API 接口。

简体中文

特性

环境要求

安装

通过 Composer 安装包:

发布配置文件和迁移文件:

运行数据库迁移:

配置

配置文件位于 config/dictionary.php

使用指南

API 端点

包提供了完整的 RESTful API 接口:

字典分类

字典项

请求示例

创建字典分类

创建字典项(手动输入键)

创建字典项(自动生成键)

获取字典项

自动生成字典键

创建字典项时,可以选择自动生成数字键:

生成示例:

在代码中使用

使用 Facade

使用模型

使用服务类

数据导入导出

导出字典数据

将当前数据库中的字典数据导出为 JSON 文件:

导入字典数据

从 JSON 文件导入字典数据:

在 DatabaseSeeder 中使用

JSON 文件格式

数据结构

字典分类表 (dictionary_categories)

字段 类型 说明
id bigint 主键
parent_id bigint 父分类ID
category_key string 分类键(唯一)
category_name string 分类名称
sort_order integer 排序
created_at timestamp 创建时间
updated_at timestamp 更新时间

字典项表 (dictionary_items)

字段 类型 说明
id bigint 主键
parent_key string 所属分类键
item_key string 字典项键
item_value string 字典项值
sort_order integer 排序
is_enabled boolean 是否启用
created_at timestamp 创建时间
updated_at timestamp 更新时间

响应格式

所有 API 接口返回统一的 JSON 格式:

成功响应

错误响应

数据保护

删除保护

唯一性约束

命令行工具

命令 说明
dictionary:export [path] 导出字典数据到 JSON 文件
dictionary:reseed [--force] 清空并重新导入字典数据

测试

更新日志

请查看 CHANGELOG 了解更多信息。

贡献

欢迎贡献代码!请查看 CONTRIBUTING 了解详情。

安全

如果发现任何安全相关问题,请发送邮件至 [email protected] 而不是使用 issue 跟踪器。

许可证

MIT 许可证。详情请查看 LICENSE 文件。

致谢


All versions of laravel-dictionary with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0 || ^12.0 || ^13.0
tucker-eric/eloquentfilter Version ^3.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package weijukeji/laravel-dictionary contains the following files

Loading the files please wait ...