Skip to content

Commit 13f7a14

Browse files
committed
refactor: rename package name + service provider improvements
1 parent 6638de9 commit 13f7a14

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Laravel Settingable
1+
# Laravel Model Settings
22

3-
Endow your Laravel models with settings!
3+
A Laravel package that allows you to assign settings to your models.
44

5-
[![Latest version](https://img.shields.io/github/release/CodeTechPt/laravel-settingable?style=flat-square)](https://github.com/CodeTechPt/laravel-settingable/releases)
6-
[![GitHub license](https://img.shields.io/github/license/CodeTechPt/laravel-settingable?style=flat-square)](https://github.com/CodeTechPt/laravel-settingable/blob/master/LICENSE)
5+
[![Latest version](https://img.shields.io/github/release/CodeTechPt/laravel-model-settings?style=flat-square)](https://github.com/CodeTechPt/laravel-model-settings/releases)
6+
[![GitHub license](https://img.shields.io/github/license/CodeTechPt/laravel-model-settings?style=flat-square)](https://github.com/CodeTechPt/laravel-model-settings/blob/master/LICENSE)
77

88

99
## Installation
1010

1111
Add the package to your Laravel app using composer
1212

1313
```
14-
composer require codetech/laravel-settingable
14+
composer require codetech/laravel-model-settings
1515
```
1616

1717

@@ -23,7 +23,7 @@ Register the package's service provider in config/app.php. In Laravel versions 5
2323
'providers' => [
2424
2525
...
26-
CodeTech\Settingable\Providers\SettingableServiceProvider::class,
26+
Codetech\ModelSettings\Providers\ModelSettingsServiceProvider::class,
2727
...
2828
2929
];
@@ -42,15 +42,15 @@ php artisan migrate
4242

4343
## Usage
4444

45-
To start logging CRUD operations simply use the trait on your models.
45+
Use the trait in your models.
4646

4747
```
4848
49-
use CodeTechCMS\Settingable\Traits\Settingable;
49+
use CodeTechCMS\ModelSettings\Traits\HasSettings;
5050
5151
class Theme extends Model
5252
{
53-
use Settingable;
53+
use HasSettings;
5454
5555
...
5656
```
@@ -67,6 +67,8 @@ $scopedSettings = $theme->settings()->ofScope('colors')->get();
6767
```
6868

6969
#### Using the config helper
70+
If you have load_into_memory enabled, you can access the settings with the config() helper.
71+
7072
```
7173
config('theme.colors.primary');
7274
```
@@ -77,7 +79,7 @@ config('theme.colors.primary');
7779

7880
## License
7981

80-
**codetech/laravel-settingable** is open-sourced software licensed under the [MIT license](https://github.com/CodeTechPt/laravel-settingable/blob/master/LICENSE).
82+
**codetech/laravel-model-settings** is open-sourced software licensed under the [MIT license](https://github.com/CodeTechPt/laravel-model-settings/blob/master/LICENSE).
8183

8284

8385
## About CodeTech

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
2-
"name": "codetech/laravel-settingable",
3-
"description": "Endow your Laravel models with settings!",
2+
"name": "codetech/laravel-model-settings",
3+
"description": "A Laravel package that allows you to assign settings to your models.",
44
"keywords": [
55
"codetech",
6-
"laravel-settingable",
7-
"laravel",
6+
"laravel-model-settings",
87
"settings",
9-
"polymorphic"
8+
"laravel",
9+
"laravel-package",
10+
"eloquent-models",
11+
"polymorphic-relations"
1012
],
1113
"authors": [
1214
{
@@ -22,15 +24,15 @@
2224
},
2325
"autoload": {
2426
"psr-4": {
25-
"CodeTech\\Settingable\\": "src/"
27+
"CodeTech\\ModelSettings\\": "src/"
2628
}
2729
},
2830
"minimum-stability": "dev",
2931
"prefer-stable": true,
3032
"extra": {
3133
"laravel": {
3234
"providers": [
33-
"CodeTech\\Settingable\\Providers\\SettingableServiceProvider"
35+
"CodeTech\\ModelSettings\\Providers\\ModelSettingsServiceProvider"
3436
]
3537
}
3638
}

src/Models/ModelSetting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodeTechCMS\Settingable\Models;
3+
namespace CodeTechCMS\ModelSettings\Models;
44

55
use Illuminate\Database\Eloquent\Builder;
66
use Illuminate\Database\Eloquent\Model;

src/Providers/SettingableServiceProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace CodeTechCMS\Settingable\Providers;
3+
namespace CodeTechCMS\ModelSettings\Providers;
44

5-
use CodeTechCMS\Settingable\Models\ModelSetting;
5+
use CodeTechCMS\ModelSettings\Models\ModelSetting;
66
use Illuminate\Support\Facades\Config;
77
use Illuminate\Support\ServiceProvider;
88

9-
class SettingableServiceProvider extends ServiceProvider
9+
class ModelSettingsServiceProvider extends ServiceProvider
1010
{
1111
/**
1212
* Register services.
@@ -16,7 +16,7 @@ class SettingableServiceProvider extends ServiceProvider
1616
public function register()
1717
{
1818
$this->mergeConfigFrom(
19-
__DIR__ . '/../config/settingable.php', 'settingable'
19+
__DIR__ . '/../config/model-settings.php', 'settingable'
2020
);
2121
}
2222

@@ -32,7 +32,7 @@ public function boot()
3232

3333
$this->setPublishableFiles();
3434

35-
if (config('settingable.load_into_memory')) {
35+
if (config('model-settings.load_into_memory')) {
3636
$this->loadSettings();
3737
}
3838
}
@@ -43,7 +43,7 @@ public function boot()
4343
private function setPublishableFiles()
4444
{
4545
$this->publishes([
46-
__DIR__ . '/../config/settingable.php' => config_path('settingable.php')
46+
__DIR__ . '/../config/model-settings.php' => config_path('model-settings.php')
4747
], 'config');
4848

4949
$this->publishes([

src/Traits/Settingable.php renamed to src/Traits/HasSettings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace CodeTechCMS\Settingable\Traits;
3+
namespace CodeTechCMS\ModelSettings\Traits;
44

5-
use CodeTechCMS\Settingable\Models\ModelSetting;
5+
use CodeTechCMS\ModelSettings\Models\ModelSetting;
66

7-
trait Settingable
7+
trait HasSettings
88
{
99
/**
1010
* Get all of this model's settings.
File renamed without changes.

0 commit comments

Comments
 (0)