Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(System): configuration option firebase to store data #35

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

nguyenthanhtuanIT
Copy link
Contributor

  • composer require kreait/laravel-firebase

  • php artisan route:cache

see #34

@nguyenthanhtuanIT nguyenthanhtuanIT force-pushed the feat/System/config-firebase branch from 7f3c0fb to 0f1404e Compare November 12, 2020 08:06
@nguyenthanhtuanIT nguyenthanhtuanIT changed the title feat(System): config option firebase to store data feat(System): configuration option firebase to store data Nov 12, 2020
*/
public function getDataByCode($code)
{
$reference = $this->getRetrievingData(GGConfig::REFERENCE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REFERENCE => SYSTEM_REFERENCE

if (empty($configInfo)) {
$firebaseService->addData(GGConfig::REFERENCE, $attributes);
} else {
if (getKeyByCode($code))
Copy link
Contributor

@HuynhHungManh HuynhHungManh Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elseif ($key = getKeyByCode($code))
$firebaseService->setData(GGConfig::REFERENCE . '/' . $key, $attributes);

* @param string $reference
* @return object
*/
public function getRetrievingData($reference = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRetrievingData => retrieveData or getData

$config = env('STORE_DB', 'database') == 'database'
? getConfigByCode($field['code'])
: app('GGPHP\Config\Services\FirebaseService')->getDataByCode($field['code']);
$value = $config ? $config['value'] : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$value = $config ? $config['value'] : null; => $value = $config['value'] ?? null

- composer require kreait/laravel-firebase

- php artisan route:cache

see #34
@nguyenthanhtuanIT nguyenthanhtuanIT force-pushed the feat/System/config-firebase branch from 0f1404e to ae0e7be Compare November 12, 2020 09:32
@HuynhHungManh HuynhHungManh merged commit b680f81 into develop Nov 12, 2020
@HuynhHungManh HuynhHungManh added the feature This issue used for adding new feature label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue used for adding new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants