1. Go to this page and download the library: Download juy/setting 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/ */
juy / setting example snippets
'Juy\Setting\SettingServiceProvider',
// Get single value
Setting::get('mail_driver');
// Get single value with default value
Setting::get('mail_driver', 'default value');
// Set single value
Setting::set('mail_driver', 'smtp');
// Set multiple key, value
Setting::insert([$key => $value]);
// Set key, value from form post data
$post = Input::except('_token'); // except for token
Setting::insert($post);
use Juy\Setting\Model\Setting;
class SettingsTableSeeder extends \Seeder {
public function run()
{
DB::table('settings')->truncate();
Setting::insert([
[
'key' => 'mail_driver',
'value' => 'smtp'
],
[
'key' => 'mail_host',
'value' => 'smtp.mailgun.org'
],
]);
}
}
shell
php artisan migrate --package=juy/setting
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.