Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getCategory($category){
- $names=explode(",",$category);
- foreach ($names as $name){
- $categories=DB::table('categories')->where('id',$name)->first();
- $categoryName=implode(',',(array)$categories->name);
- }
- return $this->$categoryName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement