有没有办法在生产中扩展 october CMS 中的用户插件
Is there a way to extend user plgin in octoberCMS in production
我想问的是,当站点已经投入生产时,是否有任何方法可以通过添加更多字段来扩展 OctoberCMS 中的用户插件。我知道如何在开发中做到这一点,但我不知道如何在生产中做到这一点。帮助
只需在开发中创建新插件即可扩展您的用户插件。
您要添加的字段只需将它们写入 update files
-> plugins\hardiksatasiya\demotest\updates
1.0.1:
- 'Initialize plugin.'
1.0.2:
- 'Created table hardiksatasiya_demotest_'
- update_user_my_custom_add_seen.php
update_user_my_custom_add_seen.php
file
<?php namespace HardikSatasiya\DemoTest\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class UpdateUserMyCustomAddSeen extends Migration
{
public function up()
{
Schema::table('users', function($table)
{
$table->timestamp('last_seen')->nullable();
});
}
public function down()
{
Schema::table('users', function($table)
{
$table->dropColumn('last_seen');
});
}
}
this example shows how to add last_seen
field in users
table
现在只需使用扩展 api 在表单 extendFormFields
https://octobercms.com/docs/backend/forms#extend-form-fields
中添加字段
如果一切正常,现在在开发服务器上测试它们。
then only put that plugin in plugins
directory
directory structure => plugins \ < author name > \ < plugin name >
now in live system - from backend logout
and login
我想这会完成所有必需的工作。
make sure you test plugin well in development. to avoid unwanted problems
如有疑问请评论。
我想问的是,当站点已经投入生产时,是否有任何方法可以通过添加更多字段来扩展 OctoberCMS 中的用户插件。我知道如何在开发中做到这一点,但我不知道如何在生产中做到这一点。帮助
只需在开发中创建新插件即可扩展您的用户插件。
您要添加的字段只需将它们写入 update files
-> plugins\hardiksatasiya\demotest\updates
1.0.1:
- 'Initialize plugin.'
1.0.2:
- 'Created table hardiksatasiya_demotest_'
- update_user_my_custom_add_seen.php
update_user_my_custom_add_seen.php
file
<?php namespace HardikSatasiya\DemoTest\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class UpdateUserMyCustomAddSeen extends Migration
{
public function up()
{
Schema::table('users', function($table)
{
$table->timestamp('last_seen')->nullable();
});
}
public function down()
{
Schema::table('users', function($table)
{
$table->dropColumn('last_seen');
});
}
}
this example shows how to add
last_seen
field inusers
table
现在只需使用扩展 api 在表单 extendFormFields
https://octobercms.com/docs/backend/forms#extend-form-fields
如果一切正常,现在在开发服务器上测试它们。
then only put that plugin in
plugins
directorydirectory structure =>
plugins \ < author name > \ < plugin name >
now in live system - from backend
logout
andlogin
我想这会完成所有必需的工作。
make sure you test plugin well in development. to avoid unwanted problems
如有疑问请评论。