Viewing: helpers.php
<?php use App\Models\Category; if (!function_exists('getCategoryTypeName')) { function getCategoryTypeName($type) { $typeName =''; if($type > 99) { switch ($type){ case $type == 100: $typeName = 'Technology'; break; case $type == 101: $typeName = 'Solution'; break; } } else { if(!empty($type)){ $typeName = Category::find($type)->name; }else{ $typeName = ""; } } return $typeName; } } ?>
Return