πŸ“€Settings

e are build a settings plugin using spatie-laravel-settings so you can use full package feature by creating the setting class and migration and we will help you to generate a page for it

Install

Add Module to modules_statuses.json if not exists

Make a migration

Publish Assets

OR

Setting Page Generator

to create a new settings page you can use this command

and put the setting name like SiteMap and your Module name

go to Modules/YourModuleName/Database/Migrations and you will get the main setting migration set your values

go to Modules/YourModuleName/Settings and add your settings as a public vars and set the group name

go to Modules/YourModuleName/Pages and you will get the settings Page edit the rows to be your selected rows type

Setting Class

the page Setting class will be look like this

Setting Migration

This command will create a new file in Modules/ModuleName/Database/Migrations where you can add the properties and their default values:

We add the properties site_name and site_active here to the general group with values Spatie and true. More on migrations later

You should migrate your database to add the properties:

now you are ready for a settings page

Settings page

our generator generate a Setting Page for you to view your settings and update it

it will generate a full settings page for you.

you can generate 'Action', 'Widget', 'Modal' and use it on the Setting Page like a Resource

Settings Helpers

we build a helper function for settings you can use it very simple

this method take a key of setting and return the payload of it

it's take the value of money and return it on the money format

Last updated