Skip to content

Commit

Permalink
Document title and subheading feature some changes..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Aug 14, 2023
1 parent af8ba97 commit 09baf19
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 26 deletions.
43 changes: 43 additions & 0 deletions app/Listeners/Update/V30/Version3017.php
@@ -0,0 +1,43 @@
<?php

namespace App\Listeners\Update\V30;

use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;

class Version3017 extends Listener
{
const ALIAS = 'core';

const VERSION = '3.0.17';

/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->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.');
}
}
4 changes: 2 additions & 2 deletions app/Models/Document/Document.php
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions app/Providers/Event.php
Expand Up @@ -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',
Expand Down
Expand Up @@ -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');
});
}

Expand Down
24 changes: 24 additions & 0 deletions resources/views/components/documents/form/company.blade.php
Expand Up @@ -7,6 +7,30 @@
</x-slot>

<x-slot name="body">
<div class="sm:col-span-2 grid gap-x-8 gap-y-6">
@stack('title_start')

@if (! $hideDocumentTitle)
<x-form.group.text
name="title"
label="{{ trans('settings.invoice.title') }}"
value="{{ $title }}"
not-required
/>
@endif

@stack('subheading_start')

@if (! $hideDocumentSubheading)
<x-form.group.text
name="subheading"
label="{{ trans('settings.invoice.subheading') }}"
value="{{ $subheading }}"
not-required
/>
@endif
</div>

<div class="sm:col-span-2">
@if (! $hideLogo)
<x-form.input.hidden name="company_logo" data-field="setting" />
Expand Down
22 changes: 0 additions & 22 deletions resources/views/components/documents/form/metadata.blade.php
Expand Up @@ -22,28 +22,6 @@
<div class="sm:col-span-1"></div>

<div class="sm:col-span-4 grid sm:grid-cols-4 gap-x-8 gap-y-6">
@stack('title_start')

@if (! $hideDocumentTitle)
<x-form.group.text
name="title"
label="{{ trans('settings.invoice.title') }}"
value="{{ $title }}"
not-required
form-group-class="sm:col-span-2" />
@endif

@stack('subheading_start')

@if (! $hideDocumentSubheading)
<x-form.group.text
name="subheading"
label="{{ trans('settings.invoice.subheading') }}"
value="{{ $subheading }}"
not-required
form-group-class="sm:col-span-2" />
@endif

@stack('issue_start')

@if (! $hideIssuedAt)
Expand Down

0 comments on commit 09baf19

Please sign in to comment.