Webhookチェックインをお惣菜コーナーに流す

This commit is contained in:
shibafu 2020-07-24 17:51:48 +09:00
parent fcdc00f165
commit 66322dfec0
3 changed files with 4 additions and 4 deletions

View File

@ -49,9 +49,9 @@ class Ejaculation extends Model
return $this->hasMany(Like::class);
}
public function scopeOnlyWebCheckin(Builder $query)
public function scopePublic(Builder $query)
{
return $query->where('ejaculations.source', Ejaculation::SOURCE_WEB);
return $query->whereIn('ejaculations.source', [Ejaculation::SOURCE_WEB, Ejaculation::SOURCE_WEBHOOK]);
}
public function scopeWithLikes(Builder $query)

View File

@ -71,7 +71,7 @@ SQL
->select('ejaculations.*')
->with('user', 'tags')
->withLikes()
->onlyWebCheckin()
->public()
->take(21)
->get();

View File

@ -19,7 +19,7 @@ class TimelineController extends Controller
->select('ejaculations.*')
->with('user', 'tags')
->withLikes()
->onlyWebCheckin()
->public()
->paginate(21);
return view('timeline.public')->with(compact('ejaculations'));