Compare commits

..

1 Commits

Author SHA1 Message Date
Shift dd15416645 Bump dependencies for Laravel 9 2022-02-17 11:21:59 +00:00
22 changed files with 13554 additions and 11171 deletions

10
.env.example Executable file → Normal file
View File

@ -1,11 +1,8 @@
APP_NAME="Your SwissCar GmbH - AutoManager"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://automngr.test
APP_PORT=80
USER_1_EMAIL=test@salloum.pm
USER_1_PW=abc123
LOG_CHANNEL=stack
LOG_LEVEL=debug
@ -14,9 +11,8 @@ DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=automngr
DB_USERNAME="sail"
DB_PASSWORD="password"
FORWARD_DB_PORT=3306
DB_USERNAME=sail
DB_PASSWORD=password
BROADCAST_DRIVER=log
CACHE_DRIVER=file

View File

@ -1,53 +0,0 @@
name: PHP Composer
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build --if-present
- name: Laravel mix
run: mix --production
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
# - name: Run test suite
# run: composer run-script test

View File

@ -11,16 +11,9 @@ Running on Laravel 8
Prerequisites:
- [Docker](https://docker.com) installed and running
- Docker compose installed
- Composer installed
- PHP installed
Steps:
1. copy .env.example to .env
2. add user credentials in .env
2. run `composer update --ignore-platform-reqs`
3. run `composer install --ignore-platform-reqs`
1. run `./vendor/bin/sail php artisan key:generate`
2. start app by running `./vendor/bin/sail up` inside the main directory (or configure a bash alias: `alias sail='bash vendor/bin/sail'`) then you can use `sail up`
3. Run migrations and seed db: `sail php artisan migrate:fresh --seed`
4. `sail npm run watch`

View File

@ -24,6 +24,4 @@ final class InsuranceType extends Enum
const FiveStar = '4';
const FiveStarPlus = '5';
const Ja = '6';
}

View File

@ -73,10 +73,10 @@ class CarController extends Controller
'known_damage' => $car->known_damage,
'seller' => $bcontract ? $bcontract->contact->full_title : null,
'buy_date' => $bcontract ? $bcontract->date_formatted : null,
'price' => $bcontract ? $bcontract->price_for_excel : null,
'price' => $bcontract ? $bcontract->price : null,
'buyer' => $scontract ? $scontract->contact->full_title : null,
'sell_date' => $scontract ? $scontract->date_formatted : null,
'sell_price' => $scontract ? $scontract->price_for_excel : null,
'sell_price' => $scontract ? $scontract->price : null,
];
});
@ -122,7 +122,7 @@ class CarController extends Controller
'known_damage' => $car->known_damage,
'seller' => $contract ? $contract->contact->full_title : null,
'buy_date' => $contract ? $contract->date_formatted : null,
'price' => $contract ? $contract->price_for_excel : null,
'price' => $contract ? $contract->price : null,
];
});
@ -172,10 +172,10 @@ class CarController extends Controller
'known_damage' => $car->known_damage,
'seller' => $bcontract ? $bcontract->contact->full_title : null,
'buy_date' => $bcontract ? $bcontract->date_formatted : null,
'price' => $bcontract ? $bcontract->price_for_excel : null,
'price' => $bcontract ? $bcontract->price : null,
'buyer' => $scontract ? $scontract->contact->full_title : null,
'sell_date' => $scontract ? $scontract->date_formatted : null,
'sell_price' => $scontract ? $scontract->price_for_excel : null,
'sell_price' => $scontract ? $scontract->price : null,
];
});

View File

@ -2,7 +2,7 @@
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@ -19,9 +19,5 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;}
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@ -78,7 +78,6 @@ class Contract extends Model
InsuranceType::ThreeStar => '3 Stern',
InsuranceType::FiveStar => '5 Stern',
InsuranceType::FiveStarPlus => '5 Stern+',
InsuranceType::Ja => 'Ja',
default => 'Nein',
};
}

View File

@ -42,25 +42,19 @@ class Payment extends Model
public function getTypeAttribute($type)
{
switch ($type) {
case PaymentType::Transaction():
return 'Banküberweisung';
case PaymentType::Cash():
return 'Barzahlung';
default:
return 'Überweisung via Cembra';
return match ($type) {
PaymentType::Transaction() => 'Banküberweisung',
PaymentType::Cash() => 'Barzahlung',
default => 'Überweisung via Cembra',
};
}
public function getTypeTextAttribute()
{
switch ($this->type) {
case 'Banküberweisung':
return 'via Banküberweisung erhalten';
case 'Barzahlung':
return 'in bar erhalten';
default:
return 'via Cembra-Überweisung erhalten';
return match ($this->type) {
'Banküberweisung' => 'via Banküberweisung erhalten',
'Barzahlung' => 'in bar erhalten',
default => 'via Cembra-Überweisung erhalten',
};
}

View File

@ -8,27 +8,28 @@
],
"license": "MIT",
"require": {
"php": "^8.1",
"barryvdh/laravel-dompdf": "^1.0",
"bensampo/laravel-enum": "^5.1",
"cknow/laravel-money": "^7.0",
"fakerphp/faker": "^1.9.1",
"php": "^7.3|^8.0",
"barryvdh/laravel-dompdf": "^0.9.0|^1.0",
"bensampo/laravel-enum": "^3.3|^5.1",
"cknow/laravel-money": "^6.1",
"fakerphp/faker": "^1.14|^1.9.1",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"inertiajs/inertia-laravel": "^0.5",
"laravel/framework": "^9.0",
"inertiajs/inertia-laravel": "^0.3.5|^0.5",
"laravel/framework": "^8.12|^9.0",
"laravel/jetstream": "^2.3",
"laravel/sanctum": "^2.6",
"laravel/tinker": "^2.5",
"maatwebsite/excel": "^3.1",
"phpoffice/phpword": "^0.18",
"phpoffice/phpword": "^0.18.2|^0.18",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
"spatie/laravel-ignition": "^1.0",
"facade/ignition": "^2.5",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^6.1",
"nunomaduro/collision": "^5.0|^6.1",
"phpunit/phpunit": "^9.3.3"
},
"autoload": {

3536
composer.lock generated

File diff suppressed because it is too large Load Diff

12
database/seeders/DatabaseSeeder.php Executable file → Normal file
View File

@ -36,20 +36,20 @@ class DatabaseSeeder extends Seeder
User::factory()->create([
'name' => 'Nadim Salloum',
'email' => env('USER_1_EMAIL', 'test@test.ch'),
'password' => bcrypt(env('USER_1_PW', 'abc123')),
'email' => env('USER_1_EMAIL'),
'password' => bcrypt(env('USER_1_PW')),
]);
User::factory()->create([
'name' => 'Mohamad Salloum',
'email' => env('USER_2_EMAIL', 'test2@test.ch'),
'password' => bcrypt(env('USER_2_PW', 'abc123')),
'email' => env('USER_2_EMAIL'),
'password' => bcrypt(env('USER_2_PW')),
]);
User::factory()->create([
'name' => 'Nadim Salloum',
'email' => env('USER_3_EMAIL', 'test3@test.ch'),
'password' => bcrypt(env('USER_3_PW', 'abc123')),
'email' => env('USER_3_EMAIL'),
'password' => bcrypt(env('USER_3_PW')),
]);
foreach ($this->getBrands() as $brandItem) {

View File

@ -3,11 +3,11 @@ version: '3'
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.1
context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.1/app
image: sail-8.0/app
ports:
- '${APP_PORT:-80}:80'
environment:

9835
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,9 +19,9 @@
"@vue/compiler-sfc": "^3.0.5",
"eslint": "^7.28.0",
"eslint-plugin-vue": "^7.11.1",
"laravel-mix": "^6.0.49",
"laravel-mix": "^6.0.6",
"postcss": "^8.1.14",
"postcss-import": "^14.0.2",
"postcss-import": "^12.0.1",
"tailwindcss": "^2.0.1",
"vue-loader": "^16.1.2"
},
@ -32,7 +32,7 @@
"vue": "^3.0.5",
"vue-currency-input": "^2.0.0",
"vue-multiselect": "^3.0.0-alpha.2",
"vue-unicons": "^3.3.1",
"vue-unicons": "^3.2.1",
"vuex": "^4.0.0"
}
}

4501
public/css/app.css vendored Executable file → Normal file

File diff suppressed because it is too large Load Diff

6656
public/js/app.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,9 +8,6 @@
</template>
<template #info>
<small-title title="Auto" class="mb-3" />
<div v-if="car.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
Auto gelöscht am {{ car.deleted_at }}
</div>
<car-card :car="car" />
</template>
<template #actions>

View File

@ -91,14 +91,14 @@ export default {
methods: {
fetchCity(newVal, oldVal) {
if (newVal !== oldVal && newVal.length === 4 && this.form.country === 'CH') {
axios.get(`https://openplzapi.org/ch/Localities?postalCode=${newVal}`)
axios.get(`https://swisspost.opendatasoft.com/api/records/1.0/search/?dataset=plz_verzeichnis_v2&q=&facet=ortbez18&refine.postleitzahl=${newVal}`)
.then((response) => {
let data = response.data;
/*if (records.length > 1) {
let records = response.data.records;
if (records.length > 1) {
records = records.filter(rec => rec.geometry);
}*/
if (data[0]) {
this.form.city = data[0].name;
}
if (records[0]) {
this.form.city = records[0].fields.ortbez18;
}
});
}

View File

@ -9,9 +9,6 @@
<template #info>
<small-title title="Kontakt" class="mb-3" />
<div v-if="contact.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
Kontakt gelöscht am {{ contact.deleted_at }}
</div>
<contact-card :contact="contact" />
</template>

View File

@ -51,7 +51,6 @@ export default {
price: this.contract.price,
notes: this.contract.notes,
insurance_type: this.contract.insurance_type,
type: this.contract.type,
},
};
},

View File

@ -5,11 +5,7 @@
</template>
<template #info>
<small-title title="Vertragsinformationen" class="mb-3" />
<div v-if="contract.deleted_at" class="col-span-12 bg-red-500 p-2 -mb-1 text-white rounded-t-md font-bold">
Vertrag gelöscht am {{ contract.deleted_at }}
</div>
<div class="grid grid-cols-12 gap-2 p-5 bg-white shadow rounded-md font-medium">
<div class="grid grid-cols-12 gap-2 p-5 bg-white shadow rounded-md font-medium">
<div class="col-span-4">
Datum
</div>

View File

@ -187,12 +187,10 @@ MwSt-Nr: CHE-226.272.050
<td>Restbetrag</td>
<td>{{ $contract->left_to_pay }}</td>
</tr>
@if ($contract->isSellContract())
<tr>
<td>Bankverbindung IBAN</td>
<td>CH69 0900 0000 1549 3981 7</td>
</tr>
@endif
<tr>
<td>Bankverbindung IBAN</td>
<td>CH69 0900 0000 1549 3981 7</td>
</tr>
<tr>
<td>Lieferdatum</td>
<td>{{ $contract->delivery_date_formatted }}</td>