rayiumir/laravel-metabox
最新稳定版本:v1.3.0
Composer 安装命令:
composer require rayiumir/laravel-metabox
包简介
Easy creation of MetaBox for Laravel
README 文档
README
Documentation
Laravel Metabox
Metabox is a highly useful feature for retrieving or displaying WordPress information. We decided to bring this Metabox functionality to Laravel. With Laravel Metabox, you can define features such as custom fields for posts without the need to create a custom field table in the database.
Installs
Install Package:
composer require rayiumir/laravel-metabox
After Publish Files:
php artisan vendor:publish --provider="Rayiumir\\LaravelMetabox\\ServiceProvider\\MetaboxServiceProvider"
And Migration Database:
php artisan migrate
How to use
Calling HasMetaboxes in Models Post.php:
use Rayiumir\LaravelMetabox\Traits\HasMetaboxes; use HasMetaboxes;
To delete post metabox data, place the following function in Post.php:
protected static function boot(): void { parent::boot(); static::deleting(function ($post) { $post->metaboxes()->delete(); }); }
Task Laravel Metabox
- Text Field
- Upload Field
- Select Field
- Checkbox Field
- Toggle Field
- Radio Button Field
- Tabs Field
- Gallery Image Field
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-14