1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Admin\Controllers\Admin;
- use Illuminate\Routing\Controller;
- use Illuminate\Support\Facades\Auth;
- class AuthController extends Controller
- {
- /**
- * Show the login page.
- *
- * @return \Illuminate\Contracts\View\Factory|Redirect|\Illuminate\View\View
- */
- public function getLogin()
- {
- if ($this->guard()->check()) {
- return redirect($this->redirectPath());
- }
- return view('admin.login');
- }
- /**
- * Get the post login redirect path.
- *
- * @return string
- */
- protected function redirectPath()
- {
- if (method_exists($this, 'redirectTo')) {
- return $this->redirectTo();
- }
- return property_exists($this, 'redirectTo') ? $this->redirectTo : config('admin.route.prefix');
- }
- /**
- * Get the guard to be used during authentication.
- *
- * @return \Illuminate\Contracts\Auth\StatefulGuard
- */
- protected function guard()
- {
- return Auth::guard('admin');
- }
- }
|