kamekun/kame-settings

Settings Module for KaMe a simple laravel CMS

0.2.6 2022-01-15 02:36 UTC

This package is auto-updated.

Last update: 2024-03-29 04:33:28 UTC


README

Latest Version on Packagist Total Downloads

This package provides the settings module for the KAME, a simple cms made with laravel, livewire and tailwind.

Requirements

PHP >= 7.3|8.0
Laravel >=7.X

Installation

Install via composer:

composer require kamekun/kame-settings

Publish

Publish config file.

php artisan vendor:publish --tag="Kamekun\\KameSettings\\KameSettingsServiceProvider"

Configure

You can change the options of your app from config/kame-settings.php file

Database

Create table for database Model

php artisan migrate

Facade

// Parameters: key, value
Setting::get('foo', 'default');
// Parameters: key, value, readOnly (optional, default false)
Setting::set('foo', 'default', true);
// Note: (ReadOnly attributes are for properties/configuration that shouldn't delete from the backend panel)

Blade Directive

You can get the settings directly in your blade templates using the helper method or the blade directive like @setting('foo')

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

I am open to contributions to this package, and will do the best I can to maintain it over time. Pull requests are welcome, and in fact encouraged. Right now there are no specific guidelines for a PR.

Road Map

Some considerations for future versions:

  • Add Support for caching Settings
  • Add support for save / read settings from json file

Credits and License

  • KaMekuN

  • Taylor Otwell and co. for Laravel

  • Caleb Porzio for livewire

  • Adam Wathan for Tailwind labs

This project is licensed under the MIT License - see the License File for details