initial project
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use App\Models\VoucherSchedule;
|
||||
use App\Models\VoucherSettings;
|
||||
|
||||
if (!function_exists('getVoucherSetting')) {
|
||||
|
||||
function getVoucherSetting($id)
|
||||
{
|
||||
$voucher_settings = new VoucherSettings();
|
||||
|
||||
$voucher = $voucher_settings
|
||||
->select('id, voucher_name')
|
||||
->where('id', $id)
|
||||
->where('deleted_at', null)
|
||||
->first();
|
||||
|
||||
if (!$voucher) {
|
||||
return []; // Or return null if preferred
|
||||
}
|
||||
|
||||
return [[
|
||||
'id' => $voucher['id'],
|
||||
'title' => $voucher['voucher_name']
|
||||
]];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user