Skip to content

Commit

Permalink
🎉 rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
willpower232 committed Jul 20, 2023
1 parent a737a00 commit 9a8f1e7
Show file tree
Hide file tree
Showing 52 changed files with 359 additions and 363 deletions.
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

102 changes: 51 additions & 51 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{
"name": "darkghosthunter/laraconfig",
"description": "Per-user settings repository system for Laravel",
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
"authors": [
{
"name": "Italo Baeza C.",
"email": "darkghosthunter@gmail.com"
"name": "synergitech/laravel-multiconfig",
"description": "Per-user settings repository system for Laravel",
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
"authors": [
{
"name": "Italo Baeza C.",
"email": "darkghosthunter@gmail.com"
}
],
"require": {
"php": ">=8.0",
"illuminate/database": "^8.43",
"illuminate/support": "^8.43",
"illuminate/collections": "^8.43",
"illuminate/config": "^8.43",
"illuminate/cache": "^8.43",
"symfony/console": "^5.3"
},
"require-dev": {
"mockery/mockery": "^1.4.3",
"orchestra/testbench": "^6.19",
"phpunit/phpunit": "^9.5.4"
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"autoload": {
"psr-4": {
"SynergiTech\\Multiconfig\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"SynergiTech\\Multiconfig\\MulticonfigServiceProvider"
],
"aliases": {
"Setting": "SynergiTech\\Multiconfig\\Facades\\Setting"
}
}
},
"scripts": {
"test": "vendor/bin/phpunit --coverage-clover build/logs/clover.xml",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
}
],
"require": {
"php": ">=8.0",
"illuminate/database": "^8.43",
"illuminate/support": "^8.43",
"illuminate/collections": "^8.43",
"illuminate/config": "^8.43",
"illuminate/cache": "^8.43",
"symfony/console": "^5.3"
},
"require-dev": {
"mockery/mockery": "^1.4.3",
"orchestra/testbench": "^6.19",
"phpunit/phpunit": "^9.5.4"
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"autoload": {
"psr-4": {
"DarkGhostHunter\\Laraconfig\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"DarkGhostHunter\\Laraconfig\\LaraconfigServiceProvider"
],
"aliases": {
"Setting": "DarkGhostHunter\\Laraconfig\\Facades\\Setting"
}
}
},
"scripts": {
"test": "vendor/bin/phpunit --coverage-clover build/logs/clover.xml",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
}
}
8 changes: 4 additions & 4 deletions config/laraconfig.php → config/multiconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
*/

'cache' => [
'enable' => env('LARACONFIG_CACHE', false),
'store' => env('LARACONFIG_STORE'),
'enable' => env('MULTICONFIG_CACHE', false),
'store' => env('MULTICONFIG_STORE'),
'duration' => 60 * 60 * 3, // Store the settings for 3 hours
'prefix' => 'laraconfig',
'prefix' => 'multiconfig',
'automatic' => true, // Regenerate the cache before garbage collection.
]
];
];
6 changes: 3 additions & 3 deletions src/Console/Commands/CleanCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DarkGhostHunter\Laraconfig\Console\Commands;
namespace SynergiTech\Multiconfig\Console\Commands;

use DarkGhostHunter\Laraconfig\Eloquent\Setting;
use SynergiTech\Multiconfig\Eloquent\Setting;
use Illuminate\Console\Command;

/**
Expand Down Expand Up @@ -49,4 +49,4 @@ protected function deleteOrphanedSettings(): int
->orDoesntHave('metadata')
->delete();
}
}
}
12 changes: 6 additions & 6 deletions src/Console/Commands/MigrateCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DarkGhostHunter\Laraconfig\Console\Commands;
namespace SynergiTech\Multiconfig\Console\Commands;

use DarkGhostHunter\Laraconfig\Migrator\Data;
use DarkGhostHunter\Laraconfig\Migrator\Migrator;
use SynergiTech\Multiconfig\Migrator\Data;
use SynergiTech\Multiconfig\Migrator\Migrator;
use Illuminate\Console\Command;
use Illuminate\Console\OutputStyle;
use RuntimeException;
Expand All @@ -21,7 +21,7 @@ class MigrateCommand extends Command
*/
protected $signature = 'settings:migrate
{--refresh : Wipes clean the settings table and metadata table.}
{--flush-cache : Flushes the cache used by Laraconfig, if enabled.}
{--flush-cache : Flushes the cache used by Multiconfig, if enabled.}
{--force : Skips confirmation prompt on production.}';

/**
Expand All @@ -34,8 +34,8 @@ class MigrateCommand extends Command
/**
* MigrateCommand constructor.
*
* @param \DarkGhostHunter\Laraconfig\Migrator\Migrator $migrator
* @param \DarkGhostHunter\Laraconfig\Migrator\Data $data
* @param \SynergiTech\Multiconfig\Migrator\Migrator $migrator
* @param \SynergiTech\Multiconfig\Migrator\Data $data
*/
public function __construct(protected Migrator $migrator, protected Data $data)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/PublishCommand.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DarkGhostHunter\Laraconfig\Console\Commands;
namespace SynergiTech\Multiconfig\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
Expand Down
12 changes: 6 additions & 6 deletions src/Eloquent/Casts/DynamicCasting.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent\Casts;
namespace SynergiTech\Multiconfig\Eloquent\Casts;

use DarkGhostHunter\Laraconfig\Eloquent\Metadata;
use DarkGhostHunter\Laraconfig\Eloquent\Setting;
use SynergiTech\Multiconfig\Eloquent\Metadata;
use SynergiTech\Multiconfig\Eloquent\Setting;
use DateTimeInterface;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Support\Arr;
Expand All @@ -18,7 +18,7 @@ class DynamicCasting implements CastsAttributes
/**
* Transform the attribute from the underlying model values.
*
* @param \DarkGhostHunter\Laraconfig\Eloquent\Setting|\DarkGhostHunter\Laraconfig\Eloquent\Metadata $model
* @param \SynergiTech\Multiconfig\Eloquent\Setting|\SynergiTech\Multiconfig\Eloquent\Metadata $model
* @param string $key
* @param mixed $value
* @param array $attributes
Expand Down Expand Up @@ -54,7 +54,7 @@ public function get(
/**
* Transform the attribute to its underlying model values.
*
* @param \DarkGhostHunter\Laraconfig\Eloquent\Setting|\DarkGhostHunter\Laraconfig\Eloquent\Metadata $model
* @param \SynergiTech\Multiconfig\Eloquent\Setting|\SynergiTech\Multiconfig\Eloquent\Metadata $model
* @param string $key
* @param mixed $value
* @param array $attributes
Expand Down Expand Up @@ -87,4 +87,4 @@ public function set(
default => $value,
};
}
}
}
6 changes: 3 additions & 3 deletions src/Eloquent/Metadata.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent;
namespace SynergiTech\Multiconfig\Eloquent;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
Expand All @@ -18,7 +18,7 @@
* @property-read \Illuminate\Support\Carbon $updated_at
* @property-read \Illuminate\Support\Carbon $created_at
*
* @property-read \Illuminate\Database\Eloquent\Collection|\DarkGhostHunter\Laraconfig\Eloquent\Setting[] $settings
* @property-read \Illuminate\Database\Eloquent\Collection|\SynergiTech\Multiconfig\Eloquent\Setting[] $settings
*
* @internal
*/
Expand Down Expand Up @@ -53,7 +53,7 @@ class Metadata extends Model
/**
* The settings this metadata has.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany|\DarkGhostHunter\Laraconfig\Eloquent\Setting
* @return \Illuminate\Database\Eloquent\Relations\HasMany|\SynergiTech\Multiconfig\Eloquent\Setting
*/
public function settings(): HasMany
{
Expand Down
8 changes: 4 additions & 4 deletions src/Eloquent/Scopes/AddMetadata.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent\Scopes;
namespace SynergiTech\Multiconfig\Eloquent\Scopes;

use DarkGhostHunter\Laraconfig\Eloquent\Metadata;
use SynergiTech\Multiconfig\Eloquent\Metadata;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
Expand All @@ -18,7 +18,7 @@ class AddMetadata implements Scope
* Apply the scope to a given Eloquent query builder.
*
* @param \Illuminate\Database\Eloquent\Builder $builder
* @param \Illuminate\Database\Eloquent\Model|\DarkGhostHunter\Laraconfig\HasConfig $model
* @param \Illuminate\Database\Eloquent\Model|\SynergiTech\Multiconfig\HasConfig $model
*
* @return void
*/
Expand Down Expand Up @@ -58,4 +58,4 @@ protected static function getColumns(): array

return $columns;
}
}
}
2 changes: 1 addition & 1 deletion src/Eloquent/Scopes/FilterBags.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent\Scopes;
namespace SynergiTech\Multiconfig\Eloquent\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
Expand Down
2 changes: 1 addition & 1 deletion src/Eloquent/Scopes/WhereConfig.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent\Scopes;
namespace SynergiTech\Multiconfig\Eloquent\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
Expand Down
18 changes: 9 additions & 9 deletions src/Eloquent/Setting.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DarkGhostHunter\Laraconfig\Eloquent;
namespace SynergiTech\Multiconfig\Eloquent;

use DarkGhostHunter\Laraconfig\MorphManySettings;
use DarkGhostHunter\Laraconfig\SettingsCache;
use SynergiTech\Multiconfig\MorphManySettings;
use SynergiTech\Multiconfig\SettingsCache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
Expand All @@ -22,7 +22,7 @@
* @property-read string $group // Added by the "add-metadata" global scope.
* @property-read string $bag // Added by the "add-metadata" global scope.
*
* @property-read \DarkGhostHunter\Laraconfig\Eloquent\Metadata $metadata
* @property-read \SynergiTech\Multiconfig\Eloquent\Metadata $metadata
*/
class Setting extends Model
{
Expand Down Expand Up @@ -68,7 +68,7 @@ class Setting extends Model
/**
* Settings cache repository.
*
* @var \DarkGhostHunter\Laraconfig\SettingsCache|null
* @var \SynergiTech\Multiconfig\SettingsCache|null
*/
public ?SettingsCache $cache = null;

Expand Down Expand Up @@ -122,7 +122,7 @@ public function user(): MorphTo
/**
* Fills the settings data from a Metadata model instance.
*
* @param \DarkGhostHunter\Laraconfig\Eloquent\Metadata $metadata
* @param \SynergiTech\Multiconfig\Eloquent\Metadata $metadata
*
* @return $this
*/
Expand Down Expand Up @@ -236,14 +236,14 @@ public function invalidateCache(): void
$this->cache->invalidateIfNotInvalidated();
// Mark the cache to be regenerated once is destructed.
$this->cache->regenerateOnExit();
} elseif (config('laraconfig.cache.enable', false)) {
} elseif (config('multiconfig.cache.enable', false)) {
[$morph, $id] = $this->getMorphs('settable', null, null);

cache()
->store(config('laraconfig.cache.store'))
->store(config('multiconfig.cache.store'))
->forget(
MorphManySettings::generateKeyForModel(
config('laraconfig.cache.prefix'),
config('multiconfig.cache.prefix'),
$this->getAttribute($morph),
$this->getAttribute($id)
)
Expand Down
10 changes: 5 additions & 5 deletions src/Facades/Setting.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace DarkGhostHunter\Laraconfig\Facades;
namespace SynergiTech\Multiconfig\Facades;

use DarkGhostHunter\Laraconfig\Registrar\SettingRegistrar;
use SynergiTech\Multiconfig\Registrar\SettingRegistrar;
use Illuminate\Support\Facades\Facade;

/**
* @method static \Illuminate\Support\Collection|\DarkGhostHunter\Laraconfig\Eloquent\Setting[] getSettings()
* @method static \DarkGhostHunter\Laraconfig\Registrar\Declaration name(string $name)
* @method static \Illuminate\Support\Collection|\SynergiTech\Multiconfig\Eloquent\Setting[] getSettings()
* @method static \SynergiTech\Multiconfig\Registrar\Declaration name(string $name)
*/
class Setting extends Facade
{
Expand All @@ -20,4 +20,4 @@ protected static function getFacadeAccessor(): string
{
return SettingRegistrar::class;
}
}
}
Loading

0 comments on commit 9a8f1e7

Please sign in to comment.