PHP code example of pxpm / backpack-crud-settings
1. Go to this page and download the library: Download pxpm/backpack-crud-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/ */
pxpm / backpack-crud-settings example snippets
use Illuminate\Database\Seeder;
class SettingsSeeder extends Seeder
{
public function run()
{
//create your array of settings like defining Backpack fields.
$settings = [
[
'name' => 'company_name',
'type' => 'text',
'label' => 'Company Name',
'tab' => 'Main',
'wrapperAttributes' => ['class' => 'col-md-6 form-group']
]
];
//call the setting manager to manage those settings. It will take care of create/update/delete settings.
app('settingsmanager')->create($settings);
}