Redirect home page to login or dashboard

This commit is contained in:
Ben Ramey
2017-11-04 19:11:38 -06:00
parent 58ffca6947
commit 3813ffc95e
3 changed files with 7 additions and 17 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class HomeController extends Controller
{
@@ -22,6 +23,10 @@ class HomeController extends Controller
*/
public function index()
{
return view('home');
if (Auth::check()) {
return redirect()->route('dashboard');
}
return redirect()->route('login');
}
}