PHP code example of afea / filament-settings
1. Go to this page and download the library: Download afea/filament-settings library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
afea / filament-settings example snippets
->plugin(\Afea\Cms\Settings\Filament\SettingsPlugin::make())
// config/afea-settings.php
'groups' => [
'company' => true,
'site' => true,
'footer' => false, // no footer? skip.
'mailing' => true,
'notification' => false,
],
use Afea\Cms\Settings\Settings\CompanySettings;
$company = app(CompanySettings::class);
$company->email;
$company->working_hours;
namespace App\Settings;
class CompanySettings extends \Afea\Cms\Settings\Settings\CompanySettings
{
public ?string $slogan = null;
}
'classes' => [
'company' => \App\Settings\CompanySettings::class,
],
$this->migrator->add('company.slogan', null);
use Afea\Cms\Settings\Filament\Pages\AbstractSettingsPage;
class BrandSettingsPage extends AbstractSettingsPage
{
protected function settingsClass(): string
{
return \App\Settings\BrandSettings::class;
}
public function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
{
return $schema->components([
// ...
])->statePath('data');
}
}