feat: Implement Spatie Laravel Settings with Filament pages for general, SEO, and social media management.

This commit is contained in:
Yoga Pangestu 2026-01-05 11:57:56 +07:00
parent 492a56504d
commit 0ffc7a1d92
12 changed files with 763 additions and 208 deletions

View File

@ -0,0 +1,77 @@
<?php
namespace App\Filament\Pages\Settings;
use App\Settings\GeneralSettings;
use BackedEnum;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Pages\SettingsPage;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use UnitEnum;
class ManageGeneralSettings extends SettingsPage
{
protected static string|BackedEnum|null $navigationIcon = Heroicon::Cog6Tooth;
protected static string $settings = GeneralSettings::class;
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
protected static ?string $navigationLabel = 'Umum';
protected static ?string $title = 'Pengaturan Umum';
public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make('Informasi')
->schema([
TextInput::make('site_name')
->label('Nama Website')
->placeholder('Simedkom')
->required()
->maxLength(255),
Textarea::make('site_description')
->label('Deskripsi Website')
->placeholder('Aplikasi Sistem Media Komunikasi Kabupaten Purwakarta')
->required(),
Textarea::make('address')
->label('Alamat')
->placeholder('Jl. Laks. Laut RE. Martadinata No.47')
->rows(3)
->required()
->maxLength(255),
RichEditor::make('about_us')
->label('Tentang Kami')
->placeholder('...')
->required()
->columnSpanFull(),
])->columnSpan(2),
Section::make('Lampiran')
->schema([
FileUpload::make('site_logo')
->label('Logo Website')
->required()
->image()
->directory('settings'),
FileUpload::make('site_icon')
->label('Icon Website')
->required()
->image()
->directory('settings'),
])->columnSpan(1),
])
->columns(3);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Pages\Settings;
use App\Settings\SeoSettings;
use BackedEnum;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Pages\SettingsPage;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use UnitEnum;
class ManageSeoSettings extends SettingsPage
{
protected static string|BackedEnum|null $navigationIcon = Heroicon::MagnifyingGlass;
protected static string $settings = SeoSettings::class;
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
protected static ?string $navigationLabel = 'SEO';
protected static ?string $title = 'Pengaturan SEO';
public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make('Search Engine Optimization')
->description('Atur bagaimana website Anda muncul di mesin pencari.')
->schema([
TextInput::make('title')
->label('SEO Title')
->helperText('Judul yang muncul di tab browser dan hasil pencarian.'),
Textarea::make('description')
->label('SEO Description')
->helperText('Deskripsi singkat website Anda.'),
TextInput::make('keywords')
->label('SEO Keywords')
->helperText('Gunakan koma untuk memisahkan kata kunci.'),
])
->columnSpanFull(),
]);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace App\Filament\Pages\Settings;
use App\Settings\SocialMediaSettings;
use BackedEnum;
use Filament\Forms\Components\TextInput;
use Filament\Pages\SettingsPage;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use UnitEnum;
class ManageSocialMediaSettings extends SettingsPage
{
protected static string|BackedEnum|null $navigationIcon = Heroicon::Share;
protected static string $settings = SocialMediaSettings::class;
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
protected static ?string $navigationLabel = 'Media Sosial';
protected static ?string $title = 'Pengaturan Media Sosial';
public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make('Link Media Sosial')
->description('Atur link media sosial resmi Anda.')
->schema([
Grid::make(2)
->schema([
TextInput::make('facebook')
->label('Facebook')
->placeholder('https://facebook.com/username')
->url(),
TextInput::make('twitter')
->label('Twitter')
->placeholder('https://twitter.com/username')
->url(),
TextInput::make('instagram')
->label('Instagram')
->placeholder('https://instagram.com/username')
->url(),
TextInput::make('youtube')
->label('YouTube')
->placeholder('https://youtube.com/username')
->url(),
]),
])
->columnSpanFull(),
]);
}
}

View File

@ -91,6 +91,14 @@ public function panel(Panel $panel): Panel
Authenticate::class, Authenticate::class,
]) ])
->databaseTransactions() ->databaseTransactions()
->viteTheme('resources/css/filament/dashboard/theme.css'); ->viteTheme('resources/css/filament/dashboard/theme.css')
->navigationGroups([
'Master',
'Kelola',
'Monitoring',
'Publikasi',
'Pengaturan',
'Pelindung',
]);
} }
} }

View File

@ -0,0 +1,25 @@
<?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class GeneralSettings extends Settings
{
public string $site_name;
public ?string $site_description;
public ?string $site_logo;
public ?string $site_icon;
public ?string $about_us;
public ?string $address;
public static function group(): string
{
return 'general';
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class SeoSettings extends Settings
{
public ?string $title;
public ?string $description;
public ?string $keywords;
public static function group(): string
{
return 'seo';
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class SocialMediaSettings extends Settings
{
public ?string $facebook;
public ?string $twitter;
public ?string $instagram;
public ?string $youtube;
public static function group(): string
{
return 'social_media';
}
}

View File

@ -14,10 +14,12 @@
"bezhansalleh/filament-shield": "^4.0", "bezhansalleh/filament-shield": "^4.0",
"filament/filament": "^4.0", "filament/filament": "^4.0",
"filament/spatie-laravel-media-library-plugin": "^4.0", "filament/spatie-laravel-media-library-plugin": "^4.0",
"filament/spatie-laravel-settings-plugin": "^4.4",
"joaopaulolndev/filament-pdf-viewer": "^2.0", "joaopaulolndev/filament-pdf-viewer": "^2.0",
"laravel/framework": "^12.0", "laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1", "laravel/tinker": "^2.10.1",
"livewire/livewire": "^3.7", "livewire/livewire": "^3.7",
"spatie/laravel-settings": "^3.6",
"spatie/laravel-sluggable": "^3.7", "spatie/laravel-sluggable": "^3.7",
"spatie/laravel-tags": "^4.10", "spatie/laravel-tags": "^4.10",
"swisnl/filament-backgrounds": "^2.0" "swisnl/filament-backgrounds": "^2.0"

543
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "ae3ade04c999827c821133e4eb005980", "content-hash": "37c52f60c416d783d4922313800eb7b5",
"packages": [ "packages": [
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@ -987,6 +987,54 @@
}, },
"time": "2024-07-08T12:26:09+00:00" "time": "2024-07-08T12:26:09+00:00"
}, },
{
"name": "doctrine/deprecations",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2025-04-07T20:06:18+00:00"
},
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
"version": "2.1.0", "version": "2.1.0",
@ -1661,6 +1709,50 @@
}, },
"time": "2025-12-09T09:54:02+00:00" "time": "2025-12-09T09:54:02+00:00"
}, },
{
"name": "filament/spatie-laravel-settings-plugin",
"version": "v4.4.0",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/spatie-laravel-settings-plugin.git",
"reference": "0d72757cddb631a31008ac0dcaccdeffd33af0c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filamentphp/spatie-laravel-settings-plugin/zipball/0d72757cddb631a31008ac0dcaccdeffd33af0c0",
"reference": "0d72757cddb631a31008ac0dcaccdeffd33af0c0",
"shasum": ""
},
"require": {
"filament/filament": "self.version",
"php": "^8.2",
"spatie/laravel-settings": "^3.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Filament\\SpatieLaravelSettingsPluginServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Filament\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Filament support for `spatie/laravel-settings`.",
"homepage": "https://github.com/filamentphp/filament",
"support": {
"issues": "https://github.com/filamentphp/filament/issues",
"source": "https://github.com/filamentphp/filament"
},
"time": "2025-12-30T13:02:26+00:00"
},
{ {
"name": "filament/support", "name": "filament/support",
"version": "v4.4.0", "version": "v4.4.0",
@ -4591,6 +4683,117 @@
}, },
"time": "2025-09-24T15:06:41+00:00" "time": "2025-09-24T15:06:41+00:00"
}, },
{
"name": "phpdocumentor/reflection-common",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"homepage": "http://www.phpdoc.org",
"keywords": [
"FQSEN",
"phpDocumentor",
"phpdoc",
"reflection",
"static analysis"
],
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
},
"time": "2020-06-27T09:03:43+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.12.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "92a98ada2b93d9b201a613cb5a33584dde25f195"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195",
"reference": "92a98ada2b93d9b201a613cb5a33584dde25f195",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.0",
"php": "^7.3 || ^8.0",
"phpdocumentor/reflection-common": "^2.0",
"phpstan/phpdoc-parser": "^1.18|^2.0"
},
"require-dev": {
"ext-tokenizer": "*",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.1",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.13.9",
"vimeo/psalm": "^4.25"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0"
},
"time": "2025-11-21T15:09:14+00:00"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.5", "version": "1.9.5",
@ -4666,6 +4869,53 @@
], ],
"time": "2025-12-27T19:41:33+00:00" "time": "2025-12-27T19:41:33+00:00"
}, },
{
"name": "phpstan/phpdoc-parser",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
"nikic/php-parser": "^5.3.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6",
"symfony/process": "^5.2"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0"
},
"time": "2025-08-30T15:50:23+00:00"
},
{ {
"name": "pragmarx/google2fa", "name": "pragmarx/google2fa",
"version": "v9.0.0", "version": "v9.0.0",
@ -6145,6 +6395,91 @@
], ],
"time": "2025-12-13T21:45:21+00:00" "time": "2025-12-13T21:45:21+00:00"
}, },
{
"name": "spatie/laravel-settings",
"version": "3.6.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-settings.git",
"reference": "fae93dadb8f748628ecaf5710f494adf790255b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-settings/zipball/fae93dadb8f748628ecaf5710f494adf790255b2",
"reference": "fae93dadb8f748628ecaf5710f494adf790255b2",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/database": "^11.0|^12.0",
"php": "^8.2",
"phpdocumentor/type-resolver": "^1.5",
"spatie/temporary-directory": "^1.3|^2.0"
},
"require-dev": {
"ext-redis": "*",
"mockery/mockery": "^1.4",
"orchestra/testbench": "^9.0|^10.0",
"pestphp/pest": "^2.0|^3.0",
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"spatie/laravel-data": "^2.0.0|^4.0.0",
"spatie/pest-plugin-snapshots": "^2.0",
"spatie/phpunit-snapshot-assertions": "^4.2|^5.0",
"spatie/ray": "^1.36"
},
"suggest": {
"spatie/data-transfer-object": "Allows for DTO casting to settings. (deprecated)"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\LaravelSettings\\LaravelSettingsServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\LaravelSettings\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ruben Van Assche",
"email": "ruben@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Store your application settings",
"homepage": "https://github.com/spatie/laravel-settings",
"keywords": [
"laravel-settings",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-settings/issues",
"source": "https://github.com/spatie/laravel-settings/tree/3.6.0"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
},
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2025-12-03T10:29:27+00:00"
},
{ {
"name": "spatie/laravel-sluggable", "name": "spatie/laravel-sluggable",
"version": "3.7.5", "version": "3.7.5",
@ -9511,54 +9846,6 @@
], ],
"time": "2025-06-23T06:07:21+00:00" "time": "2025-06-23T06:07:21+00:00"
}, },
{
"name": "doctrine/deprecations",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2025-04-07T20:06:18+00:00"
},
{ {
"name": "fakerphp/faker", "name": "fakerphp/faker",
"version": "v1.24.1", "version": "v1.24.1",
@ -10758,59 +11045,6 @@
}, },
"time": "2022-02-21T01:04:05+00:00" "time": "2022-02-21T01:04:05+00:00"
}, },
{
"name": "phpdocumentor/reflection-common",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"homepage": "http://www.phpdoc.org",
"keywords": [
"FQSEN",
"phpDocumentor",
"phpdoc",
"reflection",
"static analysis"
],
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
},
"time": "2020-06-27T09:03:43+00:00"
},
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "5.6.6", "version": "5.6.6",
@ -10875,111 +11109,6 @@
}, },
"time": "2025-12-22T21:13:58+00:00" "time": "2025-12-22T21:13:58+00:00"
}, },
{
"name": "phpdocumentor/type-resolver",
"version": "1.12.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "92a98ada2b93d9b201a613cb5a33584dde25f195"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195",
"reference": "92a98ada2b93d9b201a613cb5a33584dde25f195",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.0",
"php": "^7.3 || ^8.0",
"phpdocumentor/reflection-common": "^2.0",
"phpstan/phpdoc-parser": "^1.18|^2.0"
},
"require-dev": {
"ext-tokenizer": "*",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.1",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.13.9",
"vimeo/psalm": "^4.25"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0"
},
"time": "2025-11-21T15:09:14+00:00"
},
{
"name": "phpstan/phpdoc-parser",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
"nikic/php-parser": "^5.3.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6",
"symfony/process": "^5.2"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0"
},
"time": "2025-08-30T15:50:23+00:00"
},
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "11.0.12", "version": "11.0.12",

94
config/settings.php Normal file
View File

@ -0,0 +1,94 @@
<?php
return [
/*
* Each settings class used in your application must be registered, you can
* put them (manually) here.
*/
'settings' => [
],
/*
* The path where the settings classes will be created.
*/
'setting_class_path' => app_path('Settings'),
/*
* In these directories settings migrations will be stored and ran when migrating. A settings
* migration created via the make:settings-migration command will be stored in the first path or
* a custom defined path when running the command.
*/
'migrations_paths' => [
database_path('settings'),
],
/*
* When no repository was set for a settings class the following repository
* will be used for loading and saving settings.
*/
'default_repository' => 'database',
/*
* Settings will be stored and loaded from these repositories.
*/
'repositories' => [
'database' => [
'type' => Spatie\LaravelSettings\SettingsRepositories\DatabaseSettingsRepository::class,
'model' => null,
'table' => null,
'connection' => null,
],
'redis' => [
'type' => Spatie\LaravelSettings\SettingsRepositories\RedisSettingsRepository::class,
'connection' => null,
'prefix' => null,
],
],
/*
* The encoder and decoder will determine how settings are stored and
* retrieved in the database. By default, `json_encode` and `json_decode`
* are used.
*/
'encoder' => null,
'decoder' => null,
/*
* The contents of settings classes can be cached through your application,
* settings will be stored within a provided Laravel store and can have an
* additional prefix.
*/
'cache' => [
'enabled' => env('SETTINGS_CACHE_ENABLED', false),
'store' => null,
'prefix' => null,
'ttl' => null,
],
/*
* These global casts will be automatically used whenever a property within
* your settings class isn't a default PHP type.
*/
'global_casts' => [
DateTimeInterface::class => Spatie\LaravelSettings\SettingsCasts\DateTimeInterfaceCast::class,
DateTimeZone::class => Spatie\LaravelSettings\SettingsCasts\DateTimeZoneCast::class,
// Spatie\DataTransferObject\DataTransferObject::class => Spatie\LaravelSettings\SettingsCasts\DtoCast::class,
Spatie\LaravelData\Data::class => Spatie\LaravelSettings\SettingsCasts\DataCast::class,
],
/*
* The package will look for settings in these paths and automatically
* register them.
*/
'auto_discover_settings' => [
app_path('Settings'),
],
/*
* Automatically discovered settings classes can be cached, so they don't
* need to be searched each time the application boots up.
*/
'discovered_settings_cache_path' => base_path('bootstrap/cache'),
];

View File

@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('settings', function (Blueprint $table): void {
$table->id();
$table->string('group');
$table->string('name');
$table->boolean('locked')->default(false);
$table->json('payload');
$table->timestamps();
$table->unique(['group', 'name']);
});
}
};

View File

@ -0,0 +1,47 @@
<?php
use Spatie\LaravelSettings\Migrations\SettingsMigration;
return new class extends SettingsMigration
{
public function up(): void
{
// Website Info
$this->migrator->add('general.site_name', 'Simedkom');
$this->migrator->add('general.site_description', 'Aplikasi Sistem Media Komunikasi Kabupaten Purwakarta');
$this->migrator->add('general.site_logo', null);
$this->migrator->add('general.site_icon', null);
$this->migrator->add('general.about_us', null);
$this->migrator->add('general.address', null);
// Social Media
$this->migrator->add('social_media.facebook', null);
$this->migrator->add('social_media.twitter', null);
$this->migrator->add('social_media.instagram', null);
$this->migrator->add('social_media.youtube', null);
// SEO
$this->migrator->add('seo.title', 'SIMEDKOM');
$this->migrator->add('seo.description', 'Sistem Informasi Media Komunikasi');
$this->migrator->add('seo.keywords', 'simedkom, media, komunikasi, purwakarta, kabupaten purwakarta, diskominfo, diskominfo purwakarta, simedkom purwakarta, simedkom kabupaten purwakarta, media komunikasi, media komunikasi purwakarta');
}
public function down(): void
{
$this->migrator->delete('general.site_name');
$this->migrator->delete('general.site_description');
$this->migrator->delete('general.site_logo');
$this->migrator->delete('general.site_icon');
$this->migrator->delete('general.about_us');
$this->migrator->delete('general.address');
$this->migrator->delete('social_media.facebook');
$this->migrator->delete('social_media.twitter');
$this->migrator->delete('social_media.instagram');
$this->migrator->delete('social_media.youtube');
$this->migrator->delete('seo.title');
$this->migrator->delete('seo.description');
$this->migrator->delete('seo.keywords');
}
};