PHP code example of darshphpdev / laravel-settings
1. Go to this page and download the library: Download darshphpdev/laravel-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/ */
// Get a setting
settings()->get('site_name', 'Default site name');
// Set a setting
settings()->set('site_name', 'My Awesome Site');
// Set multiple settings
settings()->set('site_meta', [
'name' => 'My Awesome Site',
'description' => 'A great site'
]);
// Get all settings
$settings = settings()->all();
// Check if a setting exists
settings()->has('site_name');
// Remove a setting
settings()->forget('site_name');
// Clear all settings
settings()->clear();
settings()->set('my_array', ['one', 'two']); // Stored as JSON
settings()->set('my_array', ['one', 'two']); // Stored as "one,two"
settings()->set('my_array', ['one', 'two']); // Stored using PHP serialization
// With encryption enabled
settings()->set('secret_key', 'sensitive-value'); // Stored encrypted
bash
php artisan settings:install
bash
php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.