2019-03-04 22:30:34 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Ejaculation;
|
|
|
|
use Illuminate\Http\Request;
|
2020-05-22 23:53:14 +09:00
|
|
|
use Illuminate\Support\Carbon;
|
2019-03-04 22:30:34 +09:00
|
|
|
|
|
|
|
class TimelineController extends Controller
|
|
|
|
{
|
|
|
|
public function showPublic()
|
|
|
|
{
|
|
|
|
$ejaculations = Ejaculation::join('users', 'users.id', '=', 'ejaculations.user_id')
|
|
|
|
->where('users.is_protected', false)
|
|
|
|
->where('ejaculations.is_private', false)
|
|
|
|
->where('ejaculations.link', '<>', '')
|
2020-05-22 23:53:14 +09:00
|
|
|
->where('ejaculations.ejaculated_date', '<=', Carbon::now())
|
2019-03-04 22:30:34 +09:00
|
|
|
->orderBy('ejaculations.ejaculated_date', 'desc')
|
|
|
|
->select('ejaculations.*')
|
|
|
|
->with('user', 'tags')
|
2019-04-05 23:10:26 +09:00
|
|
|
->withLikes()
|
2020-08-23 12:28:21 +09:00
|
|
|
->onlyWebCheckin()
|
2019-03-04 22:30:34 +09:00
|
|
|
->paginate(21);
|
|
|
|
|
|
|
|
return view('timeline.public')->with(compact('ejaculations'));
|
|
|
|
}
|
|
|
|
}
|