22
33namespace App \Services ;
44
5+ use App \Enums \PluginType ;
56use App \Models \Plugin ;
67use Illuminate \Support \Facades \Http ;
78use Illuminate \Support \Facades \Log ;
@@ -25,7 +26,7 @@ public function buildAll(?string $githubToken = null): array
2526 {
2627 $ plugins = $ this ->getApprovedPlugins ();
2728
28- return $ this ->triggerBuild ($ plugins , $ githubToken );
29+ return $ this ->triggerBuild ($ plugins , $ githubToken, fullBuild: true );
2930 }
3031
3132 /**
@@ -107,6 +108,7 @@ protected function getApprovedPlugins(): array
107108 {
108109 return Plugin::query ()
109110 ->approved ()
111+ ->where ('type ' , PluginType::Paid)
110112 ->get ()
111113 ->map (fn (Plugin $ plugin ) => [
112114 'name ' => $ plugin ->name ,
@@ -120,7 +122,7 @@ protected function getApprovedPlugins(): array
120122 /**
121123 * @param array<int, array{name: string, repository_url: string, type: string, is_official?: bool}> $plugins
122124 */
123- protected function triggerBuild (array $ plugins , ?string $ githubToken = null ): array
125+ protected function triggerBuild (array $ plugins , ?string $ githubToken = null , bool $ fullBuild = false ): array
124126 {
125127 if (! $ this ->apiUrl || ! $ this ->apiKey ) {
126128 return [
@@ -139,7 +141,10 @@ protected function triggerBuild(array $plugins, ?string $githubToken = null): ar
139141 $ githubToken ??= config ('services.github.token ' );
140142
141143 try {
142- $ payload = ['plugins ' => $ plugins ];
144+ $ payload = [
145+ 'plugins ' => $ plugins ,
146+ 'full_build ' => $ fullBuild ,
147+ ];
143148
144149 if ($ githubToken ) {
145150 $ payload ['github_token ' ] = $ githubToken ;
0 commit comments