![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-03-07 (5 months ago) ![]() | Not yet rated by the users | Total: 31 | All time: 9,942 This week: 251![]() |
Version | License | PHP version | Categories | |||
laravel-settings 1.0 | Custom (specified... | 5 | PHP 5, Databases, Libraries, Design P... |
// Create/Update Setting
$page->setSetting('facebook_url', 'https://www.facebook.com/RaggiTech');
// Retrieve Setting's Value
echo $page->setting('facebbok_url'); // https://www.facebook.com/RaggiTech
Install the latest version using Composer:
$ composer require raggitech/laravel-settings
then publish the migration & migrate
$ php artisan vendor:publish --tag=laravel-settings
$ php artisan migrate
// An Example : (Page Model)
// Using HasSettings in Page Model
...
use RaggiTech\Laravel\Settings\HasSettings;
class Page extends Model
{
use hasSettings;
...
<a name="gs"></a>
<a name="gs_cu"></a>
use RaggiTech\Laravel\Settings\Settings;
// Single
Settings::set('website_status', true);
// Multi
Settings::set([
'website_status' => false,
'website_off_message' => 'OFFLINE!',
]);
<a name="gs_get"></a>
use RaggiTech\Laravel\Settings\Settings;
// Single
$setting = Settings::get('website_keywords'); // raggitech, raggi, ...
// All
$settings = Settings::get(); // => All General Setting
<a name="gs_dc"></a>
use RaggiTech\Laravel\Settings\Settings;
// Delete/Remove
Settings::remove('website_keywords');
// Clear
Settings::clear(); // Clearing the general settings
<a name="m"></a>
<a name="m_cu"></a>
// Single
$page->setSetting('status', true);
// Multi
$page->setSettings([
'website_url' => 'https://raggitech.com',
'facebook_url' => 'https://www.facebook.com/RaggiTech',
'twitter_url' => 'https://www.twitter.com/RaggiTech',
'instagram_url' => 'https://www.instagram.com/raggitech',
]);
<a name="m_get"></a>
// Single
$setting = $page->setting('website_url');
// All
$settings = $page->settings;
<a name="gs_dc"></a>
// Delete/Remove
$page->removeSetting('instagram_url');
// Clear
$page->clearSettings();// Clearing page's settings
<a name="scopes"></a>
// Get every element has no Settings.
$p1 = Page::withoutSettings()->get();
// Get every element has setting (status).
$p2 = Page::withSettings('status')->get();
// Get every element has setting (status == true).
$p3 = Page::withSettingsValue('status', true)->get();
// Get every element has [facebook or twitter or all] settings.
$p4 = Page::withAnySettings(['facebook', 'twitter'])->get();
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Documentation |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.