/home/kueuepay/public_html/app/Http/Controllers/Api/V1/User/SettingController.php
<?php

namespace App\Http\Controllers\Api\V1\User;

use Exception;
use App\Constants\GlobalConst;
use App\Http\Helpers\Response;
use App\Models\Admin\Language;
use App\Models\Admin\SetupKyc;
use App\Models\Admin\UsefulLink;
use App\Models\Admin\AppSettings;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Route;
use App\Models\Admin\AppOnboardScreens;
use App\Providers\Admin\CurrencyProvider;
use App\Providers\Admin\BasicSettingsProvider;

class SettingController extends Controller
{
    public function basicSettings() {
        $basic_settings = BasicSettingsProvider::get()->only(['id','site_name','site_title','base_color','timezone','site_logo','site_logo_dark','site_fav','site_fav_dark','app_launcher','app_launcher_dark','user_registration','agree_policy']);

        $user_kyc_settings = SetupKyc::UserKyc()->first() ?? false;
        if($user_kyc_settings != false) {
            $user_kyc_settings = $user_kyc_settings->status;
        }

        $basic_settings['user_kyc_status'] = (boolean) $user_kyc_settings;

        $languages = Language::select(['id','name','code','status'])->get();

        $app_settings = AppSettings::select('splash_screen_image as image','version')->first();
        $onboard_screens = AppOnboardScreens::orderByDesc('id')->where('status',1)->get()->map(function($data){
            $app_local = get_default_language_code();
            return[
                'id'            => $data->id,
                'title'         => $data->title->language->$app_local->title ?? '',
                'image'         => $data->image,
                'status'        => $data->status,
                'created_at'    => $data->created_at,
                'updated_at'    => $data->updated_at,
            ];

        });
        $base_cur = CurrencyProvider::default()->first();
        $base_cur->makeHidden(['admin_id','country','name','created_at','updated_at','type','flag','sender','receiver','default','status','editData']);

        $app_image_paths = [
            'base_url'          => url("/"),
            'path_location'     => files_asset_path_basename("app-images"),
            'default_image'     => files_asset_path_basename("default"),
        ];

        return Response::success([__("Basic settings fetch successfully!")],[
            'basic_settings'    => $basic_settings,
            'base_cur'          => $base_cur,
            'web_links'         => [
                'privacy-policy'    => setRoute('frontend.useful.links',UsefulLink::where('type',GlobalConst::USEFUL_LINK_PRIVACY_POLICY)->first()?->slug),
                'about-us'          => Route::has('frontend.about') ? route('frontend.about') : url('/'),
                'contact-us'        => Route::has('frontend.contact') ? route('frontend.contact') : url('/'),
            ],
            'languages'         => $languages,
            'splash_screen'     => $app_settings,
            'onboard_screens'   => $onboard_screens,
            'image_paths'       => [
                'base_path'         => url("/"),
                'path_location'     => files_asset_path_basename("image-assets"),
                'default_image'     => files_asset_path_basename("default"),
            ],
            'app_image_paths'   => $app_image_paths,
        ],200);
    }

    

    public function getLanguages() {
        try{
            $api_languages = get_api_languages();
        }catch(Exception $e) {
            return Response::error([$e->getMessage()],[],500);
        }

        return Response::success([__("Language data fetch successfully!")],[
            'languages' => $api_languages,
        ],200);
    }
    
}
Contact
top

Get in Touch with Us for Any Questions or Support

We’d love to hear from you! Whether you have questions, feedback, or need support, our team is here to help. Reach out to us via email, phone, or visit our office. We’re committed to providing you with exceptional service and ensuring your experience with NFC Pay is seamless and satisfying. Let’s connect!

icon

Our Location

20-22 Wenlock Road, England, N1 7GU
icon

Call us on: +03601 885399

Our office hours Monday–Friday, 9am - 9pm
icon

Email us directly

support@example.com