afzalsabbir/backpack-devtools
Composer 安装命令:
composer require afzalsabbir/backpack-devtools
包简介
Custom auth for backpack
README 文档
README
about
Our devtools helps to iterate quickly over models without too much of a hassle
This is done by several points:
-
Providing an unique command line that performs all the operations
sail artisan kda:backpack:migrate -
Providing a way to regenerate models without breaking changes (wip)
-
Provide a way to automatically save and restore seeds in sql files with an history
-
Provide a way to easily write generate diff migrations (wip)
install
sail composer require fdt2k/backpack-devtools --prefer-source
Blueprint Installation
optional sail artisan vendor:publish --tag=blueprint-config
configure blueprint
edit config/blueprint.php
set
'models_namespace' => 'BaseModels',
or whatever other namespace you want.
then replace the model migration generator with our own
'migration' => \KDA\Backpack\BlueprintMigrationGenerator::class,
in config/blueprint.php
model namespace
If you changed the namespace to other than BaseModels, you'll have to configure devtools
sail artisan vendor:publish --provider="KDA\Backpack\DevtoolsServiceProvider" --tag="config"
then change it in config/kda/backpack/devtools.php
'blueprint' => [
'source'=> 'BaseModels',
]
Automatic Seeding configuration
automatic seeding
Automatic seeding helps during development, by automatically dumping specified tables and restoring them after the migration.
just put table into the settings
'seeds'=>[
'sidebars',
'users',
'user_custom_lists',
],
without Seeders
by default you have not to worry about anything, kda:backpack:migrate will automatically reseeds with sql dumps
with Seeders
disable autorestore on migrate by setting
'should_restore_seeds'=> false,
then create a seeder like this
<?php
namespace Database\Seeders;
class SidebarSeeder extends \KDA\Backpack\Database\Seeders\HistoryFileSeeder
{
protected $history = 'sidebars';
}
Use as any other Seeder Please note that autoseeding only works with mysql, because I'm lazy
Factory namespace
by default laravel-shift/blueprint erase factories so we just have to add
use Illuminate\Database\Eloquent\Factories\Factory;
...
Factory::guessFactoryNamesUsing(function (string $modelName) {
return 'Database\Factories\\Real\\'.class_basename($modelName).'Factory';
});
to app/Providers/AppServiceProvider.php
$this->app->singleton(\Faker\Generator::class, function () {
return \Faker\Factory::create('fr_CH');
});
afzalsabbir/backpack-devtools 适用场景与选型建议
afzalsabbir/backpack-devtools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 06 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 afzalsabbir/backpack-devtools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 afzalsabbir/backpack-devtools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-02