moox/category
Composer 安装命令:
composer require moox/category
包简介
This is my package category
README 文档
README
Moox Category
This is my package category
Quick Installation
These two commmands are all you need to install the package:
composer require moox/category php artisan mooxcategory:install
Curious what the install command does? See manual installation below.
What it does
This Laravel Package Template can be used to create a package including a powerful Filament resource called Category.
Name and table for the Resource can be changed while building your package.
Using the Template
- Go to https://github.com/mooxphp/category
- Press the
Use this templatebutton - Create a new repository based on the template
- Clone the repository locally
- Run
php build.phpin the repo's directory and follow the steps- Author Name (Default: Moox Developer): Your Name
- Author Email (Default: dev@moox.org): your@mail.com
- Package Name (Default: Blog Package): Your Package
- Package Description (Default: This is my package Blog Package)
- Package Entity (Default: Category): e.g. Post
- Tablename (Default: categories): e.g. posts
After building the package, you can push the changes to GitHub and create an installable package on Packagist.org. Don't forget to adjust the README to your composer namespace.
Config
After that the Resource is highly configurable.
Tabs and Translation
Moox Core features like Dynamic Tabs and Translatable Config. See the config file for more details, but as a quick example:
/* |-------------------------------------------------------------------------- | Tabs |-------------------------------------------------------------------------- | | Define the tabs for the Resource table. They are optional, but | pretty awesome to filter the table by certain values. | You may simply do a 'tabs' => [], to disable them. | */ 'tabs' => [ 'all' => [ 'label' => 'trans//core::core.all', 'icon' => 'gmdi-filter-list', 'query' => [ [ 'field' => 'deleted_at', 'operator' => '=', 'value' => null, ], ], ], 'published' => [ 'label' => 'trans//core::core.published', 'icon' => 'gmdi-check-circle', 'query' => [ [ 'field' => 'publish_at', 'operator' => '<=', 'value' => function () { return now(); }, ], [ 'field' => 'deleted_at', 'operator' => '=', 'value' => null, ], ], ], 'scheduled' => [ 'label' => 'trans//core::core.scheduled', 'icon' => 'gmdi-schedule', 'query' => [ [ 'field' => 'publish_at', 'operator' => '>', 'value' => function () { return now(); }, ], [ 'field' => 'deleted_at', 'operator' => '=', 'value' => null, ], ], ], 'draft' => [ 'label' => 'trans//core::core.draft', 'icon' => 'gmdi-text-snippet', 'query' => [ [ 'field' => 'publish_at', 'operator' => '=', 'value' => null, ], [ 'field' => 'deleted_at', 'operator' => '=', 'value' => null, ], ], ], 'deleted' => [ 'label' => 'trans//core::core.deleted', 'icon' => 'gmdi-delete', 'query' => [ [ 'field' => 'deleted_at', 'operator' => '!=', 'value' => null, ], ], ], ], ],
All options for Tabs are explained in Moox Core docs.
Category Types
The item also support 'item' types, means you are able to configure selectable types for your Entity. By default, we provide "Post" and "Page" as example. If you don't want to use types, just empty the array and the field and column become invisible.
/* |-------------------------------------------------------------------------- | Category Types |-------------------------------------------------------------------------- | | This array contains the types of categories entities. You can delete | the types you don't need and add new ones. If you don't need | types, you can empty this array like this: 'types' => [], | */ 'types' => [ 'post' => 'Post', 'page' => 'Page', ],
Author Model
You can configure the user model used for displaying Authors. By default it is tied to App User:
/* |-------------------------------------------------------------------------- | Author Model |-------------------------------------------------------------------------- | | This sets the user model that can be used as author. It should be an | authenticatable model and support the morph relationship. | It should have fields similar to Moox User or WpUser. | */ 'user_model' => \App\Models\User::class,
You may probably use Moox User
'user_model' => \Moox\User\Models\User::class,
or Moox Press User instead:
'user_model' => \Moox\Press\Models\WpUser::class,
Manual Installation
Instead of using the install-command php artisan mooxcategory:install you are able to install this package manually step by step:
// Publish and run the migrations: php artisan vendor:publish --tag="category-migrations" php artisan migrate // Publish the config file with: php artisan vendor:publish --tag="category-config"
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
moox/category 适用场景与选型建议
moox/category 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 301 次下载、GitHub Stars 达 5, 最近一次更新时间为 2024 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「laravel package」 「filament」 「filament plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 moox/category 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 moox/category 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 moox/category 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple ASCII output of array data
Alfabank REST API integration
Package for view storage in laravel
User Approval Laravel Package
PHPUnit Pretty Result Printer
统计信息
- 总下载量: 301
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-12

