public function getArtist($name) { $artist = Artist::where('permalink', '=', $name); $artist = $artist->first(); $inside_image = Media::find($artist->inside_image); return View::make('artists.single')->with('artist', $artist)->with('inside_image', $inside_image); }
public function afterUpdate($id, $data = null) { $artist = Artist::where('artistName', '=', $data['artist'])->where('ownerId', '=', Auth::user()->_id)->first(); if ($artist == null) { $artist = new Artist(); } $artist->artistName = $data['artist']; $artist->ownerId = Auth::user()->_id; $artist->ownerName = Auth::user()->firstname . ' ' . Auth::user()->lastname; $artist->save(); return $id; }
public function show() { if ($this->params()->name) { $this->artist = Artist::where(['name' => $this->params()->name])->first(); } else { $this->artist = Artist::find($this->params()->id); } if (!$this->artist) { $this->redirectTo(['#create', 'name' => $this->params()->name]); } else { $this->redirectTo(['wiki#show', 'title' => $this->artist->name]); } }
public function api_get_artists() { Paginator::setPageName('page'); $artists = Artist::where('active', '=', 1)->paginate(PAGE_SIZE); return $artists; }
public function show() { if (!$this->params()->title) { $this->render(['text' => "no title specified"]); return; } $this->title = $this->params()->title; $this->page = WikiPage::find_page($this->params()->title, $this->params()->version); $this->posts = Post::find_by_tag_join($this->params()->title, ['limit' => 8])->select(function ($x) { return $x->can_be_seen_by(current_user()); }); $this->artist = Artist::where(['name' => $this->params()->title])->first(); $this->tag = Tag::where(['name' => $this->params()->title])->first(); $this->set_title(str_replace("_", " ", $this->params()->title)); }
public function setGroupName($name) { if (!$name) { $this->group_id = null; } else { $this->group_id = Artist::where(['name' => $name])->firstOrCreate()->id; } }