Skip to content

Commit 288f8cb

Browse files
committed
feat: add tpl for make custom UserModel
1 parent 6860277 commit 288f8cb

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<@php
2+
3+
declare(strict_types=1);
4+
5+
namespace {namespace};
6+
7+
use CodeIgniter\Shield\Models\UserModel;
8+
9+
class {class} extends UserModel
10+
{
11+
protected function initialize(): void
12+
{
13+
// Merge properties with parent
14+
$this->allowedFields = array_merge($this->allowedFields, [
15+
// Add here your custom fields
16+
// 'first_name',
17+
]);
18+
}
19+
}
20+

src/Config/Registrar.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,13 @@ public static function Toolbar(): array
4545
],
4646
];
4747
}
48+
49+
public static function Generators(): array
50+
{
51+
return [
52+
'views' => [
53+
'shield:make' => 'CodeIgniter\Shield\Commands\Generators\Views\usermodel.tpl.php',
54+
],
55+
];
56+
}
4857
}

0 commit comments

Comments
 (0)