Skip to content

Commit b190f6d

Browse files
author
Sebastian Fix
committed
wip
1 parent dc22faa commit b190f6d

37 files changed

Lines changed: 360 additions & 240 deletions

app/Models/Configuration.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,18 @@
44

55
use Illuminate\Database\Eloquent\Factories\HasFactory;
66
use Illuminate\Database\Eloquent\Model;
7-
use Spatie\Translatable\HasTranslations;
87

98
class Configuration extends Model
109
{
1110
use HasFactory;
12-
use HasTranslations;
1311

14-
public array $translatable = [
15-
'contact',
16-
'terms',
17-
'imprint',
18-
'privacy',
19-
'links',
20-
'footer',
21-
];
12+
public array $translatable = [];
2213

2314
protected $casts = [
2415
'section_services' => 'boolean',
2516
'section_products' => 'boolean',
2617
'section_technologies' => 'boolean',
2718
'section_open_source' => 'boolean',
28-
29-
'contact' => 'json',
30-
'terms' => 'json',
31-
'imprint' => 'json',
32-
'privacy' => 'json',
3319
'links' => 'json',
3420
'footer' => 'json',
3521
];

app/Providers/AppServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
namespace App\Providers;
44

5+
use App\Actions\ViewDataAction;
56
use App\Checks\FailedJobsCheck;
67
use App\Checks\FilesystemsDefaultCheck;
78
use App\Checks\JobsCheck;
89
use App\Models\News;
910
use App\Models\Product;
1011
use App\Models\Service;
1112
use Illuminate\Database\Eloquent\Model;
13+
use Illuminate\Support\Facades\Schema;
14+
use Illuminate\Support\Facades\View;
1215
use Illuminate\Support\ServiceProvider;
1316
use Spatie\Health\Checks\Checks\CacheCheck;
1417
use Spatie\Health\Checks\Checks\DebugModeCheck;
@@ -41,6 +44,9 @@ public function boot(): void
4144
FailedJobsCheck::new(),
4245
SecurityAdvisoriesCheck::new()->lastDayOfMonth(),
4346
]);
47+
48+
View::share('configuration', Schema::hasTable('configurations') ? (new ViewDataAction)->configuration(app()->getLocale()) : null);
49+
4450
}
4551

4652
private function multilanguage(): void

app/View/Components/AppLayout.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public function render(): View
1717
$locale = app()->getLocale();
1818

1919
return view('layouts.app')->with([
20-
'configuration' => (new ViewDataAction)->configuration($locale),
2120
'locales' => LocaleEnum::cases(),
2221
'locale' => Str::slug($locale),
2322
'page' => $this->page,

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"spatie/laravel-permission": "^6.7",
2424
"spatie/laravel-responsecache": "^7.6",
2525
"spatie/laravel-sitemap": "^7.3",
26-
"spatie/laravel-translatable": "^6.11",
2726
"spatie/security-advisories-health-check": "^1.2"
2827
},
2928
"require-dev": {

composer.lock

Lines changed: 13 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/seeder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
return [
4+
'seeder' => [
5+
'paperflakes' => env('SEEDER_PAPERFLAKES', false),
6+
'codebar' => env('SEEDER_CODEBAR', false),
7+
],
8+
];

database/migrations/2025_06_23_225051_create_configurations_table.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ public function up(): void
1414
Schema::create('configurations', function (Blueprint $table) {
1515
$table->id();
1616

17+
$table->string('company')->nullable();
18+
1719
$table->boolean('section_services')->default(false);
1820
$table->boolean('section_products')->default(false);
1921
$table->boolean('section_technologies')->default(false);
2022
$table->boolean('section_open_source')->default(false);
2123

22-
$table->string('logo')->nullable();
23-
$table->json('contact')->nullable();
24-
$table->json('terms')->nullable();
25-
$table->json('imprint')->nullable();
26-
$table->json('privacy')->nullable();
24+
$table->string('key');
25+
2726
$table->json('links')->nullable();
28-
$table->json('footer')->nullable();
27+
2928
$table->timestamps();
3029
});
3130
}

database/seeders/Codebar/ConfigurationsTableSeeder.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Database\Seeders\Codebar;
44

5-
use App\Enums\LocaleEnum;
65
use App\Models\Configuration;
76
use Illuminate\Database\Seeder;
87

@@ -14,27 +13,20 @@ class ConfigurationsTableSeeder extends Seeder
1413
public function run(): void
1514
{
1615
Configuration::updateOrCreate([], [
16+
17+
'company' => 'codebar Solutions AG',
18+
1719
'section_services' => false,
1820
'section_products' => false,
1921
'section_technologies' => true,
2022
'section_open_source' => true,
2123

22-
'logo' => 'layouts._logos._codebar',
23-
24-
'contact' => null,
25-
'terms' => null,
26-
'imprint' => null,
27-
'privacy' => null,
24+
'key' => '_codebar',
2825

2926
'links' => [
3027
'linkedin' => 'https://www.linkedin.com/company/codebarag',
3128
'github' => 'https://github.com/orgs/codebar-ag',
3229
],
33-
34-
'footer' => [
35-
LocaleEnum::DE->value => 'codebar Solutions AG',
36-
],
37-
3830
]);
3931
}
4032
}

0 commit comments

Comments
 (0)