Skip to content

Commit 5a6f5b8

Browse files
Merge pull request #189 from Sellist-lk/site-settings-refectoring
Site settings refectoring
2 parents 51e61c1 + 82ee077 commit 5a6f5b8

File tree

11 files changed

+85
-99
lines changed

11 files changed

+85
-99
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_NAME=Liberu
2-
APP_ENV=testing
2+
APP_ENV=local
33
APP_KEY=base64:GS0VwCqzgSVBnM0Wz/Ig610q86M+GIvyVmzQQvrL7Xw=
44
APP_DEBUG=true
55
APP_URL=http://localhost
@@ -21,6 +21,9 @@ CACHE_DRIVER=file
2121
FILESYSTEM_DISK=local
2222
SESSION_DRIVER=file
2323
SESSION_LIFETIME=120
24+
SESSION_DRIVER=cookie
25+
SESSION_DOMAIN=null
26+
SESSION_SECURE_COOKIE=false
2427

2528
CACHE_LIFETIME=60
2629

app/Helpers/SiteSettingsHelper.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/Models/SiteSettings.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"bezhansalleh/filament-shield": "^3.2",
1313
"filament/filament": "^3.2",
1414
"guzzlehttp/guzzle": "^7.8",
15+
"intelrx/sitesettings": "^1.0",
1516
"joelbutcher/socialstream": "^6.0",
1617
"laravel/framework": "^11.0",
1718
"laravel/jetstream": "^5.1",

composer.lock

Lines changed: 48 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/app.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@
175175
App\Providers\TeamServiceProvider::class,
176176
App\Providers\JetstreamServiceProvider::class,
177177
App\Providers\FortifyServiceProvider::class,
178+
179+
Intelrx\Sitesettings\SitesettingsProvider::class,
178180
])->toArray(),
179181

180182
/*
@@ -190,6 +192,7 @@
190192

191193
'aliases' => Facade::defaultAliases()->merge([
192194
// 'Example' => App\Facades\Example::class,
195+
'SiteConfig' => Intelrx\Sitesettings\SiteConfig::class,
193196
])->toArray(),
194197

195198
];

database/migrations/2023_05_25_000000_create_site_settings_table.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

database/seeders/SiteSettingsSeeder.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,31 @@
33
namespace Database\Seeders;
44

55
use Illuminate\Database\Seeder;
6-
use App\Models\SiteSettings;
6+
use Intelrx\Sitesettings\SiteConfig;
77

88
class SiteSettingsSeeder extends Seeder
99
{
1010
public function run()
1111
{
12-
SiteSettings::create([
13-
'name' => config('app.name', 'Liberu Real Estate'),
12+
$data = [
13+
'name' => config('app.name', 'Liberu '),
1414
'currency' => '£',
1515
'default_language' => 'en',
16-
'address' => '123 Real Estate St, London, UK',
16+
'address' => '123 St, London, UK',
1717
'country' => 'United Kingdom',
1818
'email' => 'info@liberurealestate.com',
19-
]);
19+
'phone_01' => '+44 123 456 7890',
20+
'phone_02' => '+44 123 456 7890',
21+
'phone_03' => '+44 123 456 7890',
22+
'phone_04' => '+44 123 456 7890',
23+
'facebook' => 'https://facebook.com/liberusoftware',
24+
'twitter' => 'https://twitter.com/liberusoftware',
25+
'github' => 'https://Github.com/liberusoftware',
26+
'youtube' => 'https://YouTube.com/@liberusoftware',
27+
];
28+
29+
foreach ($data as $key => $value) {
30+
SiteConfig::store($key, $value);
31+
}
2032
}
2133
}

resources/views/components/footer.blade.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<a href="#" class="flex items-center">
66
<x-logo/>
77
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">
8-
{{ \App\Helpers\SiteSettingsHelper::get()->name }}
8+
{{ SiteConfig::get('name') }}
99
</span>
1010
</a>
1111

@@ -15,21 +15,21 @@
1515
<div></div>
1616
<div>
1717
<h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Contact Details</h2>
18-
<span class="text-xs text-gray-600">Address : {{ \App\Helpers\SiteSettingsHelper::get()->address }}</span> <br>
19-
<span class="text-xs text-gray-600">UK Non-geographic: {{ \App\Helpers\SiteSettingsHelper::get()->phone_01 }}</span> <br>
20-
<span class="text-xs text-gray-600">UK London: {{ \App\Helpers\SiteSettingsHelper::get()->phone_02 }}</span> <br>
21-
<span class="text-xs text-gray-600">UK Mobile: {{ \App\Helpers\SiteSettingsHelper::get()->phone_03 }}</span> <br>
18+
<span class="text-xs text-gray-600">Address : {{ SiteConfig::get('address') }}</span> <br>
19+
<span class="text-xs text-gray-600">UK Non-geographic: {{ SiteConfig::get('phone_01') }}</span> <br>
20+
<span class="text-xs text-gray-600">UK London: {{ SiteConfig::get('phone_02') }}</span> <br>
21+
<span class="text-xs text-gray-600">UK Mobile: {{ SiteConfig::get('phone_03') }}</span> <br>
2222
</div>
2323
</div>
2424
</div>
2525
<hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" />
2626
<div class="sm:flex sm:items-center sm:justify-between">
2727
<span class="text-sm text-gray-500 sm:text-center dark:text-gray-400" title="{{config('app.version')}}"{{now()->year}} <a href="#"
28-
class="hover:underline">{{ \App\Helpers\SiteSettingsHelper::get()->name }}</a>. All Rights
28+
class="hover:underline">{{ SiteConfig::get('name') }}</a>. All Rights
2929
Reserved.
3030
</span>
3131
<div class="flex mt-4 space-x-6 sm:justify-center sm:mt-0">
32-
<a href="{{ \App\Helpers\SiteSettingsHelper::get('facebook') }}"
32+
<a href="{{ SiteConfig::get('facebook') }}"
3333
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
3434
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
3535
<path fill-rule="evenodd"
@@ -38,22 +38,22 @@ class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
3838
</svg>
3939
</a>
4040

41-
<a href="{{ \App\Helpers\SiteSettingsHelper::get('twitter') }}"
41+
<a href="{{ SiteConfig::get('twitter') }}"
4242
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
4343
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
4444
<path
4545
d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84" />
4646
</svg>
4747
</a>
48-
<a href="{{ \App\Helpers\SiteSettingsHelper::get('github') }}"
48+
<a href="{{ SiteConfig::get('github') }}"
4949
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
5050
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
5151
<path fill-rule="evenodd"
5252
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
5353
clip-rule="evenodd" />
5454
</svg>
5555
</a>
56-
<a href="{{ \App\Helpers\SiteSettingsHelper::get('youtube') }}"
56+
<a href="{{ SiteConfig::get('youtube') }}"
5757
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
5858
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
5959
height="24" fill="currentColor" viewBox="0 0 24 24">

resources/views/components/home-navbar.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a href="/" class="flex items-center space-x-3 rtl:space-x-reverse">
1616
<x-logo/>
1717
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">
18-
{{ \App\Helpers\SiteSettingsHelper::get()->name }}
18+
{{ SiteConfig::get('name') }}
1919
</span>
2020
</a>
2121

0 commit comments

Comments
 (0)