Ejemplo n.º 1
0
 /**
  * @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');
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }
Ejemplo n.º 3
0
 /**
  * @param $hash
  * @param \jorenvanhocht\Blogify\Models\Tag $tag
  * @return mixed
  */
 public function getTag($hash, Tag $tag)
 {
     return $tag->byHash($hash);
 }