未ログイントップにお知らせを置いてみた
This commit is contained in:
1 parent
3ea9476aa8
commit
69f619e2af
2 files changed
+17
-8
No files matched your search
@@ -27,17 +27,17 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (Auth::check()) {
|
||||
$informations = Information::query()
|
||||
->select('id', 'category', 'pinned', 'title', 'created_at')
|
||||
->orderByDesc('pinned')
|
||||
->orderByDesc('created_at')
|
||||
->paginate(3);
|
||||
$categories = Information::CATEGORIES;
|
||||
$informations = Information::query()
|
||||
->select('id', 'category', 'pinned', 'title', 'created_at')
|
||||
->orderByDesc('pinned')
|
||||
->orderByDesc('created_at')
|
||||
->paginate(3);
|
||||
$categories = Information::CATEGORIES;
|
||||
|
||||
if (Auth::check()) {
|
||||
return view('home')->with(compact('informations', 'categories'));
|
||||
} else {
|
||||
return view('guest');
|
||||
return view('guest')->with(compact('informations', 'categories'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user