public function parent() { $item = Categories::whereId($this->parent)->first(); if ($this->parent != 0 && isset($item)) { return Categories::where('id', $this->parent)->first()->title; } else { return false; } }