Skip to content

Commit 1f2d49e

Browse files
committed
settings and roles
1 parent 9bb4c26 commit 1f2d49e

File tree

8 files changed

+45
-24
lines changed

8 files changed

+45
-24
lines changed

app/Filament/Admin/Pages/ManageGeneralSettings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ManageGeneralSettings extends SettingsPage
2525
public function form(Schema $schema): Schema
2626
{
2727
return $schema
28+
->columns(1)
2829
->components([
2930
Section::make('Site Information')
3031
->schema([

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function panel(Panel $panel): Panel
7070
->authMiddleware([
7171
Authenticate::class,
7272
TeamsPermission::class,
73+
])
74+
->plugins([
75+
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
7376
]);
7477

7578
// if (Features::hasApiFeatures()) {

app/Providers/Filament/AppPanelProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ public function panel(Panel $panel): Panel
8282
->authMiddleware([
8383
Authenticate::class,
8484
TeamsPermission::class,
85-
])
86-
->plugins([
87-
// \BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
8885
]);
8986

9087
// if (Features::hasApiFeatures()) {

app/Settings/GeneralSettings.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Settings;
4+
5+
use Spatie\LaravelSettings\Settings;
6+
7+
class GeneralSettings extends Settings
8+
{
9+
10+
public string $site_name;
11+
public string $site_email;
12+
public ?string $site_phone;
13+
public ?string $site_address;
14+
public ?string $site_country;
15+
public string $site_currency;
16+
public string $site_default_language;
17+
public ?string $facebook_url;
18+
public ?string $twitter_url;
19+
public ?string $github_url;
20+
public ?string $youtube_url;
21+
public string $footer_copyright;
22+
23+
public static function group(): string
24+
{
25+
return 'general';
26+
}
27+
}

resources/views/components/footer.blade.php

Lines changed: 11 additions & 12 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-
{{ SiteConfig::get('name') }}
8+
{{ app(\App\Settings\GeneralSettings::class)->site_name }}
99
</span>
1010
</a>
1111

@@ -15,21 +15,20 @@
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 : {{ 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>
18+
<span class="text-xs text-gray-600">Address : {{ app(\App\Settings\GeneralSettings::class)->site_address }}</span> <br>
19+
<span class="text-xs text-gray-600">UK Non-geographic: {{ app(\App\Settings\GeneralSettings::class)->site_phone }}</span> <br>
20+
<span class="text-xs text-gray-600">UK London: </span> <br>
21+
<span class="text-xs text-gray-600">UK Mobile: </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">
27-
<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">{{ SiteConfig::get('name') }}</a>. All Rights
29-
Reserved.
27+
<span class="text-sm text-gray-500 sm:text-center dark:text-gray-400" title="{{config('app.version')}}">
28+
{{ app(\App\Settings\GeneralSettings::class)->footer_copyright }}
3029
</span>
3130
<div class="flex mt-4 space-x-6 sm:justify-center sm:mt-0">
32-
<a href="{{ SiteConfig::get('facebook') }}"
31+
<a href="{{ app(\App\Settings\GeneralSettings::class)->facebook_url }}"
3332
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
3433
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
3534
<path fill-rule="evenodd"
@@ -38,22 +37,22 @@ class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
3837
</svg>
3938
</a>
4039

41-
<a href="{{ SiteConfig::get('twitter') }}"
40+
<a href="{{ app(\App\Settings\GeneralSettings::class)->twitter_url }}"
4241
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
4342
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
4443
<path
4544
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" />
4645
</svg>
4746
</a>
48-
<a href="{{ SiteConfig::get('github') }}"
47+
<a href="{{ app(\App\Settings\GeneralSettings::class)->github_url }}"
4948
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
5049
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
5150
<path fill-rule="evenodd"
5251
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"
5352
clip-rule="evenodd" />
5453
</svg>
5554
</a>
56-
<a href="{{ SiteConfig::get('youtube') }}"
55+
<a href="{{ app(\App\Settings\GeneralSettings::class)->youtube_url }}"
5756
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
5857
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
5958
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-
{{ SiteConfig::get('name') }}
18+
{{ app(\App\Settings\GeneralSettings::class)->site_name }}
1919
</span>
2020
</a>
2121

resources/views/layouts/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<meta name="csrf-token" content="{{ csrf_token() }}">
77

8-
<title>{{ SiteConfig::get('name') }}</title>
8+
<title>{{ app(\App\Settings\GeneralSettings::class)->site_name }}</title>
99

1010
@if(config('googletagmanager.id'))
1111
@include('googletagmanager::head')

setup.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ echo "🎬 DEV ---> php artisan db:seed"
7272
if ! php artisan db:seed; then
7373
echo "Database seeding failed."
7474
exit 1
75-
fi
76-
php artisan db:seed
77-
if ! php artisan db:seed; then
78-
echo "Database seeding failed."
79-
exit 1
80-
fi
81-
php artisan db:seed
75+
fi
8276
echo ""
8377

8478
echo "🎬 DEV ---> Running PHPUnit tests"

0 commit comments

Comments
 (0)