Files
cheerstothe_season_2.0/app/Services/APIs/CustomerAPIs/RulesApiServices.php
sayliraut b0e083df6d changes
2024-07-24 14:44:32 +05:30

42 lines
1.1 KiB
PHP

<?php
namespace App\Services\APIs\CustomerAPIs;
use App\Models\ManageReferralRule;
use App\Models\ManageRule;
use Illuminate\Support\Facades\Log;
use Exception;
class RulesApiServices
{
public function getVoucherRules()
{
try {
$data = ManageRule::select('id', 'whats_inside', 'rules')
->get()
->toArray();
return $data;
} catch (Exception $ex) {
Log::error('Voucher rules and regulation Get service failed : ' . $ex->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
public function getReferralRules()
{
try {
$data = ManageReferralRule::select('id', 'how_it_works', 'rules','what_is_referral')
->get()
->toArray();
return $data;
} catch (Exception $ex) {
Log::error('Voucher rules and regulation Get service failed : ' . $ex->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
}