@@ -63,8 +63,10 @@ protected function createPersonalClient(ClientRepository $clients)
6363 config ('app.name ' ).' Personal Access Client '
6464 );
6565
66+ $ provider = $ this ->promptForProvider ();
67+
6668 $ client = $ clients ->createPersonalAccessClient (
67- null , $ name , 'http://localhost '
69+ null , $ name , 'http://localhost ' , $ provider
6870 );
6971
7072 $ this ->info ('Personal access client created successfully. ' );
@@ -85,13 +87,7 @@ protected function createPasswordClient(ClientRepository $clients)
8587 config ('app.name ' ).' Password Grant Client '
8688 );
8789
88- $ providers = array_keys (config ('auth.providers ' ));
89-
90- $ provider = $ this ->option ('provider ' ) ?: $ this ->choice (
91- 'Which user provider should this client use to retrieve users? ' ,
92- $ providers ,
93- in_array ('users ' , $ providers ) ? 'users ' : null
94- );
90+ $ provider = $ this ->promptForProvider ();
9591
9692 $ client = $ clients ->createPasswordGrantClient (
9793 null , $ name , 'http://localhost ' , $ provider
@@ -154,6 +150,22 @@ protected function createAuthCodeClient(ClientRepository $clients)
154150 $ this ->outputClientDetails ($ client );
155151 }
156152
153+ /**
154+ * Ask the user what user provider should be used.
155+ *
156+ * @return string
157+ */
158+ protected function promptForProvider ()
159+ {
160+ $ providers = array_keys (config ('auth.providers ' ));
161+
162+ return $ this ->option ('provider ' ) ?: $ this ->choice (
163+ 'Which user provider should this client use to retrieve users? ' ,
164+ $ providers ,
165+ in_array ('users ' , $ providers ) ? 'users ' : null
166+ );
167+ }
168+
157169 /**
158170 * Output the client's ID and secret key.
159171 *
0 commit comments