From 10e49e1994f18fcbd6196fa8f0b112ad7551c3e2 Mon Sep 17 00:00:00 2001 From: Vikram Chand Date: Mon, 3 Jun 2024 15:48:51 +0530 Subject: [PATCH 1/3] Updated: CMS module and theme version in VaahCMS setup --- Libraries/VaahSetup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/VaahSetup.php b/Libraries/VaahSetup.php index 734c8d719..9bdea3688 100644 --- a/Libraries/VaahSetup.php +++ b/Libraries/VaahSetup.php @@ -84,7 +84,7 @@ public static function createVaahCmsJsonFile($request) "excerpt"=> "CMS is a framework for creating, managing, and deploying customized content types and fields.", "author_name"=> "Vaah", "author_website"=> "https://vaah.dev", - "version"=> "v2.0.1", + "version"=> "v2.0.4", "is_sample_data_available"=> true, "import_sample_data"=> false, ], @@ -100,7 +100,7 @@ public static function createVaahCmsJsonFile($request) "github_url"=> "https://github.com/webreinvent/vaahcms-theme-bulma", "author_name"=> "WebReinvent", "author_website"=> "https://webreinvent.com", - "version"=> "v0.0.2", + "version"=> "v0.0.6", "is_sample_data_available"=> true, "import_sample_data"=> true, ] From d4c1872789070f818e3705ec51c79d902f89d97f Mon Sep 17 00:00:00 2001 From: Vikram Chand Date: Sat, 22 Jun 2024 15:12:54 +0530 Subject: [PATCH 2/3] Added: public publish assets method --- Http/Controllers/Api/PublicController.php | 62 +++++++++++++++++++++++ Routes/api.php | 6 ++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/Http/Controllers/Api/PublicController.php b/Http/Controllers/Api/PublicController.php index 9947afef0..8f4ab7fa6 100644 --- a/Http/Controllers/Api/PublicController.php +++ b/Http/Controllers/Api/PublicController.php @@ -7,7 +7,9 @@ use Illuminate\Http\Request; use Illuminate\Routing\Controller; use WebReinvent\VaahCms\Libraries\VaahHelper; +use WebReinvent\VaahCms\Models\Module; use WebReinvent\VaahCms\Models\Setting; +use WebReinvent\VaahCms\Models\Theme; use WebReinvent\VaahCms\Models\User; @@ -60,5 +62,65 @@ public function disableMfa(Request $request,$token) } //---------------------------------------------------------- + public function publishAssets(Request $request,$slug) + { + try{ + + $module = Module::slug($slug)->first(); + + if (!$module) { + + $theme = Theme::slug($slug)->first(); + + if(!$theme){ + $response['success'] = false; + $response['errors'][] = "Module/Theme not found."; + return response()->json($response); + } + + $message = Theme::copyAssets($theme); + + if (!$message) { + $response['success'] = false; + $response['errors'][] = "Something went wrong."; + return response()->json($response); + } + + $theme->is_assets_published = 1; + $theme->save(); + $response['success'] = true; + $response['messages'][] = "Assets published."; + return response()->json($response); + } + + $message = Module::copyAssets($module); + + if (!$message) { + $response['success'] = false; + $response['errors'][] = "Something went wrong."; + return response()->json($response); + } + + $module->is_assets_published = 1; + $module->save(); + $response['success'] = true; + $response['messages'][] = "Assets published."; + } catch (\Exception $e) { + $response = []; + $response['success'] = false; + + if(env('APP_DEBUG')){ + $response['errors'][] = $e->getMessage(); + $response['hint'][] = $e->getTraceAsString(); + } else { + $response['errors'][] = trans("vaahcms-general.something_went_wrong"); + } + } + + + return response()->json($response); + + } + //---------------------------------------------------------- } diff --git a/Routes/api.php b/Routes/api.php index 1bf8cf029..ed9a9b623 100644 --- a/Routes/api.php +++ b/Routes/api.php @@ -28,6 +28,10 @@ function () { //------------------------------------------------ Route::any( '/disable/mfa/{api_token}', 'PublicController@disableMfa' ) ->name( 'vh.backend.disable.mfa' ); + //------------------------------------------------ + Route::any( '/publish/assets/{slug}', 'PublicController@publishAssets' ) + ->name( 'vh.backend.publish.assets' ); + }); Route::group( @@ -159,5 +163,3 @@ function () { Route::any( '/{column}/{value}/delete', 'TaxonomyTypesController@delete' ); }); }); - - From 4a4ffc4730306132e955ea411eb98dad043a1ef1 Mon Sep 17 00:00:00 2001 From: Pradeep Date: Wed, 26 Jun 2024 15:13:17 +0530 Subject: [PATCH 3/3] updated: version to v2.2.13 --- Config/vaahcms.php | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Config/vaahcms.php b/Config/vaahcms.php index cda080cf8..cc98e9033 100644 --- a/Config/vaahcms.php +++ b/Config/vaahcms.php @@ -8,7 +8,7 @@ $settings = [ 'app_name' => 'VaahCMS', 'app_slug' => 'vaahcms', - 'version' => '2.2.12', + 'version' => '2.2.13', 'php_version_required' => '8.1', 'get_config_version' => false, 'website' => 'https://vaah.dev/cms', diff --git a/composer.json b/composer.json index f53edfe78..b62b004c4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "webreinvent/vaahcms", - "version": "2.2.12", + "version": "2.2.13", "description": "VaahCMS is a laravel based open-source web application development platform shipped with headless content management system.", "keywords": ["vaahcms", "headless", "hmvc", "laravel", "cms", "vue", "pinia"], "homepage": "https://webreinvent.com",