diff --git a/How-To.txt b/How-To.txt index 8cfe76e..0814f9e 100644 --- a/How-To.txt +++ b/How-To.txt @@ -1,6 +1,14 @@ -git clone this repository +# On local machine +#git clone this repository composer install -#php artisan key:generate +php artisan key:generate touch database/database.sqlite && php artisan migrate npm install -npm run build \ No newline at end of file +npm run build + +# On Docker +cp .env.example .env.docker +docker compose build +docker compose up -d + + diff --git a/app/Models/Client.php b/app/Models/Client.php index 08cbfe3..40c2dfb 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -57,14 +57,19 @@ class Client extends Model public function getFullAddressAttribute(): string { + $line3_parts = array_filter([$this->city, $this->state]); + $country_part = array_filter([$this->postal_code, $this->country]); + $country_str = implode(' - ', $country_part); + if ($country_str) { + $line3_parts[] = $country_str; + } + $line3 = implode(', ', $line3_parts); + return collect([ $this->address_line1, $this->address_line2, - $this->city, - $this->state, - $this->postal_code, - $this->country, - ])->filter()->implode(', '); + $line3 + ])->filter()->implode("\n"); } public function getInitialsAttribute(): string diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index 6b58234..5d90172 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -133,7 +133,7 @@ @if($client->full_address)