tissue/app/Http/Controllers/TimelineController.php
shibafu 3a05d2c9cc
Merge pull request #354 from shikorism/feature/319-csv-import
チェックインデータのインポート
2020-05-23 16:35:31 +09:00

28 lines
827 B
PHP

<?php
namespace App\Http\Controllers;
use App\Ejaculation;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
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', '<>', '')
->where('ejaculations.ejaculated_date', '<=', Carbon::now())
->orderBy('ejaculations.ejaculated_date', 'desc')
->select('ejaculations.*')
->with('user', 'tags')
->withLikes()
->onlyWebCheckin()
->paginate(21);
return view('timeline.public')->with(compact('ejaculations'));
}
}