本文整理汇总了PHP中Artist::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Artist::where方法的具体用法?PHP Artist::where怎么用?PHP Artist::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Artist
的用法示例。
在下文中一共展示了Artist::where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArtist
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);
}
示例2: afterUpdate
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;
}
示例3: show
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]);
}
}
示例4: api_get_artists
public function api_get_artists()
{
Paginator::setPageName('page');
$artists = Artist::where('active', '=', 1)->paginate(PAGE_SIZE);
return $artists;
}
示例5: show
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));
}
示例6: setGroupName
public function setGroupName($name)
{
if (!$name) {
$this->group_id = null;
} else {
$this->group_id = Artist::where(['name' => $name])->firstOrCreate()->id;
}
}