SHARE
TWEET

Untitled

a guest Aug 12th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function getCategory($category){
  2.  
  3.       $names=explode(",",$category);
  4.  
  5.       foreach ($names as $name){
  6.  
  7.           $categories=DB::table('categories')->where('id',$name)->first();
  8.  
  9.           $categoryName=implode(',',(array)$categories->name);
  10.  
  11.       }
  12.  
  13.         return $this->$categoryName;
  14.  
  15.     }
RAW Paste Data
Top