本文整理匯總了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;
}
}