PHP code example of arandu / laravel-site-options
1. Go to this page and download the library: Download arandu/laravel-site-options 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/ */
arandu / laravel-site-options example snippets
bash
php artisan vendor:publish --provider="Arandu\LaravelSiteOptions\SiteOptionsServiceProvider"
bash
php artisan migrate
php
use Arandu\LaravelSiteOptions\Option;
// Store options
Option::set('welcome_message', 'Hello, World!');
Option::set('site_settings', ['theme' => 'dark', 'layout' => 'wide']);
// Retrieve options
echo Option::get('welcome_message');
$settings = Option::get('site_settings', [
// ... the default settings
]);
// Check if an option exists
if (Option::has('maintenance_mode')) {
// Perform action
}
// Remove options
Option::rm('outdated_option');