Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add setting() helper; fix invalid defaults for mysql in table
- Loading branch information
Showing
7 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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,32 @@ | ||
<?php | ||
|
||
namespace App\Repositories; | ||
|
||
use App\Models\Setting; | ||
use App\Repositories\Traits\CacheableRepository; | ||
use Prettus\Repository\Contracts\CacheableInterface; | ||
|
||
class SettingRepository extends BaseRepository implements CacheableInterface | ||
{ | ||
use CacheableRepository; | ||
|
||
public function model() | ||
{ | ||
return Setting::class; | ||
} | ||
|
||
/** | ||
* Get a setting, reading it from the cache | ||
* @param array $key | ||
* @return mixed|void | ||
*/ | ||
public function get($key) | ||
{ | ||
|
||
} | ||
|
||
public function set($key, $value) | ||
{ | ||
|
||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
/** | ||
* Shortcut for retrieving a setting value | ||
*/ | ||
if (!function_exists('setting')) { | ||
function setting($key, $value = null) | ||
{ | ||
$settingRepo = app('setting'); | ||
if($value === null) { | ||
return $settingRepo->get($key); | ||
} else { | ||
$settingRepo->set($key, $value); | ||
} | ||
} | ||
} |
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
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