1public function manualLogin(){
2 $user = User::find(1);
3 Auth::login($user);
4 return redirect('/');
5}
6///////////////////////////////////////////////////////////////
7// or
8
9Auth::logout();
1<!DOCTYPE html>
2<html lang="{{ app()->getLocale() }}">
3<head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7
8 <!-- CSRF Token -->
9 <meta name="csrf-token" content="{{ csrf_token() }}">
10
11 <title>{{ $pageTitle ?? config('app.name', 'Admin') }}</title>
12
13 <!-- Scripts -->
14 <script src="{{ asset('js/app.js') }}" defer></script>
15
16 <!-- Fonts -->
17 <link rel="dns-prefetch" href="https://fonts.gstatic.com">
18 <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
19
20 <!-- Styles -->
21 <link href="{{ asset('css/app.css') }}" rel="stylesheet">
22</head>
23<body>
24 <div id="app">
25 <nav class="navbar navbar-expand-md navbar-light navbar-laravel">
26 <div class="container">
27 <a class="navbar-brand" href="{{ route('admin.home') }}">
28 Admin
29 </a>
30 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
31 <span class="navbar-toggler-icon"></span>
32 </button>
33
34 <div class="collapse navbar-collapse" id="navbarSupportedContent">
35 <!-- Left Side Of Navbar -->
36
37
38 <!-- Right Side Of Navbar -->
39 <ul class="navbar-nav ml-auto">
40 <!-- Authentication Links -->
41 @guest('admin')
42 <li><a class="nav-link" href="{{ route('admin.login') }}">{{ __('Admin Login') }}</a></li>
43 @else
44 <li class="nav-item dropdown">
45 <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
46 {{ Auth::user()->name }} <span class="caret"></span>
47 </a>
48
49 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
50 <a class="dropdown-item" href="{{ route('admin.logout') }}"
51 onclick="event.preventDefault();
52 document.getElementById('logout-form').submit();">
53 {{ __('Logout') }}
54 </a>
55
56 <form id="logout-form" action="{{ route('admin.logout') }}" method="POST" style="display: none;">
57 @csrf
58 </form>
59 </div>
60 </li>
61 @endguest
62 </ul>
63 </div>
64 </div>
65 </nav>
66
67 <main class="py-4">
68 @yield('content')
69 </main>
70 </div>
71</body>
72</html>
73
1public function up()
2{
3 Schema::create('admins', function (Blueprint $table) {
4 $table->bigIncrements('id');
5 $table->string('name');
6 $table->string('email')->unique();
7 $table->string('password');
8 $table->rememberToken();
9 $table->timestamps();
10 });
11}
12