Download the PHP package ngankt2/filament-db-config-encrypt without Composer

On this page you can find all versions of the php package ngankt2/filament-db-config-encrypt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-db-config-encrypt

Filament DB Config Encrypt

Latest Version on Packagist Total Downloads License

A Filament plugin for managing database-backed application settings and editable content with caching and encryption support. It provides an Artisan command to generate settings pages and a helper function to retrieve settings in Blade templates or PHP code.

This project is a fork of https://github.com/inerba/filament-db-config. I only retrieved the source code to customize and use it privately, including renaming namespaces and adding several scenarios for encrypting data before storage.

Special thanks to the original author for their great work.

Features

Requirements

Installation

Install the package via Composer:

After installation, publish the configuration file and run the migrations:

This will create a db_config table in your database to store settings.

Configuration

The configuration file is located at config/db-config.php. Below is an example configuration:

Usage

Generating a Settings Page

Use the provided Artisan command to generate a Filament settings page:

This command will:

The generated page extends Ngankt2\DbConfig\AbstractPageSettings and includes methods to define the settings group, default data, and form schema.

Defining Settings

Edit the generated settings page to define the form schema and default data. For example:

Accessing Settings

Use the db_config() helper function to retrieve settings in Blade templates or PHP code:

The helper retrieves settings from the db_config table, using the cache if configured. If encryption is enabled, the settings are automatically decrypted.

Saving Settings

The generated settings page includes a "Save" action that persists form data to the database. When the form is submitted, the save() method in AbstractPageSettings stores the data under the specified group and key, with optional merging of existing values.

Customizing the View

When generating a settings page, you can choose to create a custom Blade view. If you opt out, the page uses the default view (db-config::settings-base). To customize the view, specify a custom view path during generation:

Then, edit the generated Blade view (e.g., resources/views/db-config/[panel-id].general-settings.blade.php) to customize the layout.

Database Structure

The db_config table has the following structure:

Column Type Description
group string The settings group (e.g., 'default' or tenant ID).
key string The settings key (e.g., 'general').
settings text The JSON-encoded (and optionally encrypted) settings value.
created_at timestamp Creation timestamp.
updated_at timestamp Last update timestamp.

Advanced Usage

Bypassing Cache

To retrieve settings without using the cache:

Merging Settings

By default, settings are merged with existing values. To override instead of merging, override the getMerge() method in your settings page:

Custom Group Name

To use a different group name for settings, override the groupName() method:

Contributing

Contributions are welcome! Please submit a pull request or open an issue on the GitHub repository.

Support

If you encounter any issues or have questions, please open an issue on the GitHub repository or contact the author at [email protected].

License

This package is open-sourced software licensed under the MIT license.


All versions of filament-db-config-encrypt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ngankt2/laravel-helper Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ngankt2/filament-db-config-encrypt contains the following files

Loading the files please wait ...