<?php
namespace App\Helpers;
use App\Models\Notifikasi;
use DateTime;
use App\Models\Transaksi;
class Helper {
public static function generateBreadcrumb($breadcrumbs){
$html = '<div class="page-title">';
$html .= '<h4 class="mb-0 font-size-18">' . end($breadcrumbs)['title'] . '</h4>';
$html .= '<ol class="breadcrumb">';
foreach ($breadcrumbs as $key => $breadcrumb) {
$active = ($key === count($breadcrumbs) - 1) ? 'active' : '';
if ($active === 'active') {
$html .= '<li class="breadcrumb-item ' . $active . '">' . $breadcrumb['title'] . '</li>';
} else {
$html .= '<li class="breadcrumb-item"><a href="' . $breadcrumb['url'] . '">' . $breadcrumb['title'] . '</a></li>';
}
}
$html .= '</ol>';
$html .= '</div>';
return $html;
}
public static function filterIntegers($string)
{
// Remove all non-integer characters
return preg_replace('/\D/', '', $string);
}
public static function notifikasi($keterangan, $user_id, $status) {
$notifikasi = new Notifikasi;
$notifikasi->keterangan = $keterangan;
$notifikasi->user_id = $user_id;
$notifikasi->status = $status;
$notifikasi->save();
return $notifikasi;
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]