public function getDestroy($id) { $tag = Site::find($id)->tag; if (Site::destroy($id) && TagController::getDestroy($tag->id)) { echo 'empty'; } }