We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
UserModel
1 parent 6860277 commit 288f8cbCopy full SHA for 288f8cb
2 files changed
src/Commands/Generators/Views/usermodel.tpl.php
@@ -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
@@ -45,4 +45,13 @@ public static function Toolbar(): array
45
],
46
];
47
}
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
57
0 commit comments