Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/Actions/ViewDataAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\DTO\ContactDTO;
use App\Enums\ContactSectionEnum;
use App\Models\Configuration;
use App\Models\Contact;
use App\Models\News;
use App\Models\Product;
Expand All @@ -14,6 +15,15 @@

class ViewDataAction
{
public function configuration(string $locale): ?Configuration
{
$key = Str::slug("configuration_{$locale}");

return Cache::rememberForever($key, function () {
return Configuration::first();
});
}

public function products(string $locale): Collection
{
$key = Str::slug("products_published_{$locale}");
Expand Down
19 changes: 19 additions & 0 deletions app/Models/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class Configuration extends Model
{
use HasFactory;
use HasTranslations;

public array $translatable = ['footer'];

protected $casts = [
'footer' => 'json',
];
}
1 change: 1 addition & 0 deletions app/View/Components/AppLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function render(): View
$locale = app()->getLocale();

return view('layouts.app')->with([
'configuration' => (new ViewDataAction)->configuration($locale),
'locales' => LocaleEnum::cases(),
'locale' => Str::slug($locale),
'page' => $this->page,
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"spatie/laravel-permission": "^6.7",
"spatie/laravel-responsecache": "^7.6",
"spatie/laravel-sitemap": "^7.3",
"spatie/laravel-translatable": "^6.11",
"spatie/security-advisories-health-check": "^1.2"
},
"require-dev": {
Expand Down
85 changes: 84 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions database/factories/ConfigurationFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Configuration>
*/
class ConfigurationFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('configurations', function (Blueprint $table) {
$table->id();
$table->string('logo')->nullable();
$table->json('contact')->nullable();
$table->json('terms')->nullable();
$table->json('imprint')->nullable();
$table->json('privacy')->nullable();
$table->json('footer')->nullable();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('configurations');
}
};
23 changes: 23 additions & 0 deletions database/seeders/Codebar/ConfigurationsTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Seeders\Codebar;

use App\Enums\LocaleEnum;
use App\Models\Configuration;
use Illuminate\Database\Seeder;

class ConfigurationsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Configuration::updateOrCreate([], [
'logo' => 'layouts._logos._codebar',
'footer' => [
LocaleEnum::DE->value => 'codebar Solutions AG',
],
]);
}
}
3 changes: 3 additions & 0 deletions database/seeders/CodebarSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Database\Seeders;

use Database\Seeders\Codebar\ConfigurationsTableSeeder;
use Illuminate\Cache\Console\ClearCommand;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;
Expand All @@ -15,6 +16,8 @@ class CodebarSeeder extends Seeder
*/
public function run(): void
{
$this->call(ConfigurationsTableSeeder::class);

if (app()->isLocal()) {
Artisan::call(ClearCommand::class);
}
Expand Down
23 changes: 23 additions & 0 deletions database/seeders/Paperflakes/ConfigurationsTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Seeders\Paperflakes;

use App\Enums\LocaleEnum;
use App\Models\Configuration;
use Illuminate\Database\Seeder;

class ConfigurationsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Configuration::updateOrCreate([], [
'logo' => 'layouts._logos._paperflakes',
'footer' => [
LocaleEnum::DE->value => 'paperflakes AG',
],
]);
}
}
2 changes: 2 additions & 0 deletions database/seeders/PaperflakesSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Database\Seeders;

use Database\Seeders\Paperflakes\ConfigurationsTableSeeder;
use Database\Seeders\Paperflakes\ContactsTableSeeder;
use Database\Seeders\Paperflakes\NewsTableSeeder;
use Database\Seeders\Paperflakes\PagesTableSeeder;
Expand All @@ -18,6 +19,7 @@ class PaperflakesSeeder extends Seeder
*/
public function run(): void
{
$this->call(ConfigurationsTableSeeder::class);
$this->call(PagesTableSeeder::class);
$this->call(NewsTableSeeder::class);
$this->call(ProductsTableSeeder::class);
Expand Down
1 change: 1 addition & 0 deletions lang/de_CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"EN": "EN",
"English": "English",
"Google Maps": "Google Maps",
"Headquarter": "Hauptsitz",
"Imprint": "Impressum",
"Info(at)paperflakes.ch": "Info(at)paperflakes.ch",
"Jobs": "Jobs",
Expand Down
1 change: 1 addition & 0 deletions lang/en_CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"EN": "EN",
"English": "English",
"Google Maps": "Google Maps",
"Headquarter": "Headquarter",
"Imprint": "Imprint",
"Info(at)paperflakes.ch": "Info(at)paperflakes.ch",
"Jobs": "Jobs",
Expand Down
7 changes: 5 additions & 2 deletions resources/views/app/about-us/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
<x-list-grid>

@foreach($contacts->employee_services as $contact)
<x-list-image-card :name="$contact->name" :role="$contact->role" :icons="$contact->icons"
:image="$contact->image"/>
<x-list-image-card
:name="$contact->name"
:role="$contact->role"
:icons="$contact->icons"
:image="$contact->image"/>
@endforeach
</x-list-grid>
@endif
Expand Down
14 changes: 8 additions & 6 deletions resources/views/app/contact/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ classAttributes="block"/>

<x-section>
<x-h2 :title="__('Office')"/>

<div class="grid grid-cols-2">
<div class="">
<address class="not-italic leading-relaxed ">
<p class="font-semibold">paperflakes AG</p>
<p class="italic">{{ __('Headquarter') }}</p>
<p class="font-light">Haupstrasse 91</p>
<p class="font-light">CH-4455 Zunzgen</p>
</address>
<x-a-badge href="https://www.google.com/maps/place/Hauptstrasse+91,+4455+Zunzgen,+Schweiz" label="{{ __('Google Maps') }}" class-attributes="mt-1" target="_blank" rel="noopener noreferrer">
<x-a-badge href="https://www.google.com/maps/place/Hauptstrasse+91,+4455+Zunzgen,+Schweiz"
label="{{ __('Google Maps') }}" class-attributes="mt-1" target="_blank"
rel="noopener noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="ml-1 size-3">
<path stroke-linecap="round" stroke-linejoin="round"
Expand All @@ -34,20 +36,20 @@ classAttributes="block"/>
<div class="">
<address class="not-italic leading-relaxed ">
<p class="font-semibold">paperflakes AG</p>
<p class="font-normal">{{__('Branch office')}}</p>
<p class="italic">{{__('Branch office')}}</p>
<p class="font-light">Langegasse 39</p>
<p class="font-light">CH-4104 Oberwil</p>
</address>
<x-badge label="{{ __('Oktober 2025') }}" class-attributes="mt-1" rel="noopener noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="text-gray-400 ml-1 size-3">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/>
</svg>
</x-badge>
</div>
</div>

</x-section>

</x-app-layout>
10 changes: 2 additions & 8 deletions resources/views/app/legal/imprint/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<x-app-layout :page="$page">
<x-h1 :title="__('Imprint')"/>

<x-section>
<x-h2 :title="__('Company')"/>

<address class="not-italic text-gray-700 text-lg leading-relaxed">
<p class="font-semibold">paperflakes AG</p>
<p>Mühlematten 12</p>
<p>CH-4455 Zunzgen</p>
<p>CHE-432.585.498</p>
</address>

<x-a-badge href="https://zefix.ch/de/search/entity/list/firm/1598166" label="{{ __('Zefix') }}"
class-attributes="mt-1" target="_blank" rel="noopener noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="ml-1 size-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"/>
<x-a-badge href="https://zefix.ch/de/search/entity/list/firm/1598166" label="{{ __('Zefix') }}" class-attributes="mt-1" target="_blank" rel="noopener noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="ml-1 size-3"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"/>
</svg>
</x-a-badge>
</x-section>
Expand Down
Loading