/** * @param string $hash * @return \Illuminate\Http\RedirectResponse */ public function destroy($hash) { $tag = $this->tag->byHash($hash); $tag->delete(); $this->tracert->log('tags', $tag->id, $this->auth_user->id, 'delete'); $message = trans('blogify::notify.success', ['model' => 'Tags', 'name' => $tag->name, 'action' => 'deleted']); session()->flash('notify', ['success', $message]); return redirect()->route('admin.tags.index'); }
/** * @param $tags * @return array */ private function buildTagsArrayForPostObject($tags) { if ($tags == "") { return []; } $aTags = []; $hashes = explode(',', $tags); foreach ($hashes as $tag) { array_push($aTags, $this->tag->byHash($tag)); } return $aTags; }
/** * @param $hash * @param \jorenvanhocht\Blogify\Models\Tag $tag * @return mixed */ public function getTag($hash, Tag $tag) { return $tag->byHash($hash); }