File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,25 @@ class ServiceProvider extends AddonServiceProvider
3434 public function bootAddon ()
3535 {
3636 $ this
37+ ->bootFieldModels ()
3738 ->bootBladeDirectives ()
3839 ->bootValidators ()
3940 ->bootLivewire ()
4041 ->bootSelectableFieldtypes ()
4142 ->bootFormConfigFields ();
4243 }
4344
45+ protected function bootFieldModels (): self
46+ {
47+ $ defaultModels = data_get (require (__DIR__ .'/../config/livewire-forms.php ' ), 'models ' );
48+
49+ $ userModels = config ('livewire-forms.models ' );
50+
51+ config ()->set ('livewire-forms.models ' , array_merge ($ defaultModels , $ userModels ));
52+
53+ return $ this ;
54+ }
55+
4456 protected function bootBladeDirectives (): self
4557 {
4658 foreach (get_class_methods (BladeDirectives::class) as $ method ) {
You can’t perform that action at this time.
0 commit comments