I would like to have general home page
and a different homepage for logged-in users
I search a lot on google but I can\'t find what to put in my if statement
I t
// routes.php
Route::get('/', 'homecontroller@index');
// homecontroller.php
class homecontroller extends BaseController
{
public function index()
{
if (!Auth:: check()) {
return $this->indexForGuestUser();
} else {
return $this->indexForLoggedUser();
}
}
private function indexForLoggedUser()
{
// do whatever you want
}
private function indexForGuestUser()
{
// do whatever you want
}
}