@@ -43,7 +43,6 @@ public function register()
43
43
$ this ->registerAssets ();
44
44
$ this ->registerAuthorizer ();
45
45
$ this ->registerFilterBindings ();
46
- $ this ->registerCommands ();
47
46
}
48
47
49
48
/**
@@ -53,10 +52,30 @@ public function register()
53
52
public function registerAssets ()
54
53
{
55
54
$ configPath = __DIR__ . '/../config/oauth2.php ' ;
56
- $ migrationsPath = __DIR__ . '/../migrations ' ;
55
+ $ mFrom = __DIR__ . '/../migrations/ ' ;
56
+ $ mTo = $ this ->app ['path.database ' ] . '/migrations/ ' ;
57
57
$ this ->mergeConfigFrom ($ configPath , 'oauth2 ' );
58
58
$ this ->publishes ([$ configPath => config_path ('oauth2.php ' )], 'config ' );
59
- $ this ->publishes ([$ migrationsPath => $ this ->app ['path.database ' ] . '/migrations ' ], 'migrations ' );
59
+ $ this ->publishes ([
60
+ $ mFrom . '2014_04_24_110304_create_oauth_grants_table.php ' => $ mTo . $ this ->ts (1 ) . 'create_oauth_grants_table.php ' ,
61
+ $ mFrom . '2014_04_24_110403_create_oauth_grant_scopes_table.php ' => $ mTo . $ this ->ts (2 ) . 'create_oauth_grant_scopes_table.php ' ,
62
+ $ mFrom . '2014_04_24_110459_create_oauth_clients_table.php ' => $ mTo . $ this ->ts (3 ) . 'create_oauth_clients_table.php ' ,
63
+ $ mFrom . '2014_04_24_110557_create_oauth_client_endpoints_table.php ' => $ mTo . $ this ->ts (4 ) . 'create_oauth_client_endpoints_table.php ' ,
64
+ $ mFrom . '2014_04_24_110705_create_oauth_client_scopes_table.php ' => $ mTo . $ this ->ts (5 ) . 'create_oauth_client_scopes_table.php ' ,
65
+ $ mFrom . '2014_04_24_110817_create_oauth_client_grants_table.php ' => $ mTo . $ this ->ts (6 ) . 'create_oauth_client_grants_table.php ' ,
66
+ $ mFrom . '2014_04_24_111002_create_oauth_sessions_table.php ' => $ mTo . $ this ->ts (7 ) . 'create_oauth_sessions_table.php ' ,
67
+ $ mFrom . '2014_04_24_111109_create_oauth_session_scopes_table.php ' => $ mTo . $ this ->ts (8 ) . 'create_oauth_session_scopes_table.php ' ,
68
+ $ mFrom . '2014_04_24_111254_create_oauth_auth_codes_table.php ' => $ mTo . $ this ->ts (9 ) . 'create_oauth_auth_codes_table.php ' ,
69
+ $ mFrom . '2014_04_24_111403_create_oauth_auth_code_scopes_table.php ' => $ mTo . $ this ->ts (10 ) . 'create_oauth_auth_code_scopes_table.php ' ,
70
+ $ mFrom . '2014_04_24_111518_create_oauth_access_tokens_table.php ' => $ mTo . $ this ->ts (11 ) . 'create_oauth_access_tokens_table.php ' ,
71
+ $ mFrom . '2014_04_24_111657_create_oauth_access_token_scopes_table.php ' => $ mTo . $ this ->ts (12 ) . 'create_oauth_access_token_scopes_table.php ' ,
72
+ $ mFrom . '2014_04_24_111810_create_oauth_refresh_tokens_table.php ' => $ mTo . $ this ->ts (13 ) . 'create_oauth_refresh_tokens_table.php ' ,
73
+ ], 'migrations ' );
74
+ }
75
+
76
+ protected function ts ($ seconds )
77
+ {
78
+ return Carbon::now ()->addSecond ($ seconds )->toDateString ()->format ('Y_m_d_His ' ).'_ ' ;
60
79
}
61
80
62
81
/**
@@ -144,19 +163,6 @@ public function provides()
144
163
return ['oauth2-server.authorizer ' ];
145
164
}
146
165
147
- /**
148
- * Registers some utility commands with artisan
149
- * @return void
150
- */
151
- public function registerCommands ()
152
- {
153
- $ this ->app ->bind ('command.oauth2-server.controller ' , 'LucaDegasperi\OAuth2Server\Console\OAuthControllerCommand ' );
154
- $ this ->app ->bind ('command.oauth2-server.migrations ' , 'LucaDegasperi\OAuth2Server\Console\MigrationsCommand ' );
155
- $ this ->app ->bind ('command.oauth2-server.client.create ' , 'LucaDegasperi\OAuth2Server\Console\ClientCreatorCommand ' );
156
-
157
- $ this ->commands ('command.oauth2-server.controller ' , 'command.oauth2-server.migrations ' , 'command.oauth2-server.client.create ' );
158
- }
159
-
160
166
/**
161
167
* Boot the filters
162
168
* @return void
@@ -166,6 +172,5 @@ private function bootFilters()
166
172
$ this ->app ['router ' ]->filter ('check-authorization-params ' , 'LucaDegasperi\OAuth2Server\Filters\CheckAuthCodeRequestFilter ' );
167
173
$ this ->app ['router ' ]->filter ('oauth ' , 'LucaDegasperi\OAuth2Server\Filters\OAuthFilter ' );
168
174
$ this ->app ['router ' ]->filter ('oauth-owner ' , 'LucaDegasperi\OAuth2Server\Filters\OAuthOwnerFilter ' );
169
- $ this ->app ['router ' ]->middleware ('LucaDegasperi\OAuth2Server\Middleware\OAuthExceptionHandlerMiddleware ' );
170
175
}
171
176
}
0 commit comments