@@ -60,32 +60,26 @@ public function configMapping(): array
60
60
61
61
public function install (): SocialProvider
62
62
{
63
- if ($ this ->provider ) {
64
- return $ this ->provider ;
65
- }
66
-
67
- $ provider = SocialProvider::whereCode ($ this ->code )->first ();
68
- $ this ->provider = $ provider ;
69
- if ($ provider ) {
70
- return $ provider ;
71
- }
72
-
73
- $ provider = new SocialProvider ();
74
- $ provider ->name = $ this ->name ;
75
- $ provider ->code = $ this ->code ;
76
- $ provider ->provider_class = get_called_class ();
77
- $ provider ->supports_auth = $ this ->supportsAuth ;
78
- $ provider ->enabled = false ;
79
- $ provider ->auth_enabled = false ;
80
- $ provider ->can_be_renamed = $ this ->canBeRenamed ;
63
+ $ this ->provider = SocialProvider::whereCode ($ this ->code )->first ();
64
+ if (!$ this ->provider ) {
65
+ $ provider = new SocialProvider ();
66
+ $ this ->provider = $ provider ;
67
+ $ provider ->name = $ this ->name ;
68
+ $ provider ->code = $ this ->code ;
69
+ $ provider ->provider_class = get_called_class ();
70
+ $ provider ->supports_auth = $ this ->supportsAuth ;
71
+ $ provider ->enabled = false ;
72
+ $ provider ->auth_enabled = false ;
73
+ $ provider ->can_be_renamed = $ this ->canBeRenamed ;
74
+
75
+ DB ::transaction (function () use ($ provider ) {
76
+ $ provider ->save ();
77
+ $ this ->installSettings ();
78
+ });
81
79
82
- DB ::transaction (function () use ($ provider ) {
83
80
$ provider ->save ();
84
- $ this ->installSettings ();
85
- });
86
-
87
- $ provider ->save ();
88
- return $ provider ;
81
+ }
82
+ return $ this ->provider ;
89
83
}
90
84
91
85
public function installSettings (): void
0 commit comments