From 09baf1991f11665875980f78b8923944f38b92f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 14 Aug 2023 15:36:38 +0300 Subject: [PATCH] Document title and subheading feature some changes.. --- app/Listeners/Update/V30/Version3017.php | 43 +++++++++++++++++++ app/Models/Document/Document.php | 4 +- app/Providers/Event.php | 1 + ...s.php => 2023_08_14_000000_core_v3017.php} | 4 +- .../documents/form/company.blade.php | 24 +++++++++++ .../documents/form/metadata.blade.php | 22 ---------- 6 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 app/Listeners/Update/V30/Version3017.php rename database/migrations/{2023_01_19_153034_add_title_subheading_to_documents.php => 2023_08_14_000000_core_v3017.php} (81%) diff --git a/app/Listeners/Update/V30/Version3017.php b/app/Listeners/Update/V30/Version3017.php new file mode 100644 index 00000000000..bfb02a221da --- /dev/null +++ b/app/Listeners/Update/V30/Version3017.php @@ -0,0 +1,43 @@ +skipThisUpdate($event)) { + return; + } + + Log::channel('stdout')->info('Updating to 3.0.17 version...'); + + $this->updateDatabase(); + + Log::channel('stdout')->info('Done!'); + } + + public function updateDatabase(): void + { + Log::channel('stdout')->info('Updating database...'); + + Artisan::call('migrate', ['--force' => true]); + + Log::channel('stdout')->info('Database updated.'); + } +} diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index b6d699f7388..39d986a4868 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -53,10 +53,10 @@ class Document extends Model 'contact_state', 'contact_zip_code', 'contact_city', - 'notes', - 'footer', 'title', 'subheading', + 'notes', + 'footer', 'parent_id', 'created_from', 'created_by', diff --git a/app/Providers/Event.php b/app/Providers/Event.php index c954a0db24c..2f4da579699 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -25,6 +25,7 @@ class Event extends Provider 'App\Listeners\Update\V30\Version3014', 'App\Listeners\Update\V30\Version3015', 'App\Listeners\Update\V30\Version3016', + 'App\Listeners\Update\V30\Version3017', ], 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\Auth\Login', diff --git a/database/migrations/2023_01_19_153034_add_title_subheading_to_documents.php b/database/migrations/2023_08_14_000000_core_v3017.php similarity index 81% rename from database/migrations/2023_01_19_153034_add_title_subheading_to_documents.php rename to database/migrations/2023_08_14_000000_core_v3017.php index f12930a640d..59157b306d5 100644 --- a/database/migrations/2023_01_19_153034_add_title_subheading_to_documents.php +++ b/database/migrations/2023_08_14_000000_core_v3017.php @@ -14,8 +14,8 @@ public function up() { Schema::table('documents', function (Blueprint $table) { - $table->string('title')->nullable()->default(''); - $table->string('subheading')->nullable()->default(''); + $table->string('title')->nullable()->after('contact_country'); + $table->string('subheading')->nullable()->after('title'); }); } diff --git a/resources/views/components/documents/form/company.blade.php b/resources/views/components/documents/form/company.blade.php index 2aa16faa27c..1b239adad35 100644 --- a/resources/views/components/documents/form/company.blade.php +++ b/resources/views/components/documents/form/company.blade.php @@ -7,6 +7,30 @@ +
+ @stack('title_start') + + @if (! $hideDocumentTitle) + + @endif + + @stack('subheading_start') + + @if (! $hideDocumentSubheading) + + @endif +
+
@if (! $hideLogo) diff --git a/resources/views/components/documents/form/metadata.blade.php b/resources/views/components/documents/form/metadata.blade.php index 028fde815f4..b91833d5f28 100644 --- a/resources/views/components/documents/form/metadata.blade.php +++ b/resources/views/components/documents/form/metadata.blade.php @@ -22,28 +22,6 @@
- @stack('title_start') - - @if (! $hideDocumentTitle) - - @endif - - @stack('subheading_start') - - @if (! $hideDocumentSubheading) - - @endif - @stack('issue_start') @if (! $hideIssuedAt)