-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '058949f8ce4a3d3387078368e13ae9163cf4ac13' as 'Modules/S…
…etting'
- Loading branch information
Showing
5,103 changed files
with
2,035 additions
and
931,865 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/vendor | ||
/node_modules | ||
/public/storage | ||
Homestead.yaml | ||
Homestead.json | ||
.env | ||
.idea/ | ||
.php_cs.cache | ||
vendor/ | ||
composer.lock | ||
Modules/ |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
language: php | ||
|
||
php: | ||
- 7 | ||
- 5.6 | ||
- hhvm | ||
|
||
env: | ||
- LARAVEL_VERSION="~5.1" TESTBENCH_VERSION="~3.1" | ||
|
||
before_script: | ||
- travis_retry composer install --no-interaction --prefer-source | ||
|
||
script: phpunit | ||
|
||
sudo: false | ||
|
||
notifications: | ||
slack: asgardcms:85rIXCjkamzxitmc0opndGga | ||
email: | ||
- [email protected] | ||
- [email protected] | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Blade\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
final class SettingDirective extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'setting.setting.directive'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Blade; | ||
|
||
final class SettingDirective | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $settingName; | ||
/** | ||
* @var string | ||
*/ | ||
private $locale; | ||
/** | ||
* @var string Default value | ||
*/ | ||
private $default; | ||
|
||
/** | ||
* @param $arguments | ||
*/ | ||
public function show($arguments) | ||
{ | ||
$this->extractArguments($arguments); | ||
|
||
return setting($this->settingName, $this->locale, $this->default); | ||
} | ||
|
||
/** | ||
* @param array $arguments | ||
*/ | ||
private function extractArguments(array $arguments) | ||
{ | ||
$this->settingName = array_get($arguments, 0); | ||
$this->locale = array_get($arguments, 1); | ||
$this->default = array_get($arguments, 2); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Contracts; | ||
|
||
interface Setting | ||
{ | ||
/** | ||
* Determine if the given configuration value exists. | ||
* | ||
* @param string $key | ||
* @return bool | ||
*/ | ||
public function has($key); | ||
|
||
/** | ||
* Get the specified configuration value in the given language | ||
* | ||
* @param string $key | ||
* @param string $locale | ||
* @param mixed $default | ||
* @return string | ||
*/ | ||
public function get($key, $locale = null, $default = null); | ||
|
||
/** | ||
* Set a given configuration value. | ||
* | ||
* @param string $key | ||
* @param mixed $value | ||
* @return \Modules\Setting\Entities\Setting | ||
*/ | ||
public function set($key, $value); | ||
} |
34 changes: 34 additions & 0 deletions
34
Database/Migrations/2014_10_14_200250_create_settings_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateSettingsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('setting__settings', function (Blueprint $table) { | ||
$table->engine = 'InnoDB'; | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->string('plainValue')->nullable(); | ||
$table->boolean('isTranslatable'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('setting__settings'); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Database/Migrations/2014_10_15_191204_create_setting_translations_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateSettingTranslationsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('setting__setting_translations', function (Blueprint $table) { | ||
$table->engine = 'InnoDB'; | ||
$table->increments('id'); | ||
$table->integer('setting_id')->unsigned(); | ||
$table->string('locale')->index(); | ||
$table->string('value'); | ||
$table->text('description')->nullable(); | ||
$table->unique(['setting_id', 'locale']); | ||
$table->foreign('setting_id')->references('id')->on('setting__settings')->onDelete('cascade'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('setting__setting_translations'); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Database/Migrations/2015_06_18_170048_make_settings_value_text_field.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class MakeSettingsValueTextField extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('setting__settings', function (Blueprint $table) { | ||
$table->text('plainValue')->string('plainValue')->change(); | ||
}); | ||
Schema::table('setting__setting_translations', function (Blueprint $table) { | ||
$table->text('value')->string('value')->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('setting__settings', function (Blueprint $table) { | ||
$table->string('plainValue')->text('plainValue')->change(); | ||
}); | ||
Schema::table('setting__setting_translations', function (Blueprint $table) { | ||
$table->string('value')->text('value')->change(); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Database/Migrations/2015_10_22_130947_make_settings_name_unique.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class MakeSettingsNameUnique extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('setting__settings', function (Blueprint $table) { | ||
$table->unique('name', 'setting__settings_name_unique'); | ||
$table->index('name', 'setting__settings_name_index'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('setting__settings', function (Blueprint $table) { | ||
$table->dropUnique('setting__settings_name_unique'); | ||
$table->dropIndex('setting__settings_name_index'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Database\Seeders; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Seeder; | ||
use Modules\Setting\Repositories\SettingRepository; | ||
|
||
class SettingDatabaseSeeder extends Seeder | ||
{ | ||
/** | ||
* @var SettingRepository | ||
*/ | ||
private $setting; | ||
|
||
public function __construct(SettingRepository $setting) | ||
{ | ||
$this->setting = $setting; | ||
} | ||
|
||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
Model::unguard(); | ||
|
||
$data = [ | ||
'core::template' => 'Flatly', | ||
'core::locales' => ['en'], | ||
]; | ||
|
||
$this->setting->createOrUpdate($data); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Entities; | ||
|
||
use Dimsav\Translatable\Translatable; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Setting extends Model | ||
{ | ||
use Translatable; | ||
|
||
public $translatedAttributes = ['value', 'description']; | ||
protected $fillable = ['name', 'value', 'description', 'isTranslatable', 'plainValue']; | ||
protected $table = 'setting__settings'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Modules\Setting\Entities; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class SettingTranslation extends Model | ||
{ | ||
public $timestamps = false; | ||
protected $fillable = ['value', 'description']; | ||
protected $table = 'setting__setting_translations'; | ||
} |
Oops, something went wrong.