Переглянути джерело

add admin authentication and dashboard functionality

master
Amirul Anwar 12 години тому
джерело
коміт
17481e2c7f

+ 34
- 0
app/Http/Controllers/AdminController.php Переглянути файл

@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use App\Models\User;
6
+use Illuminate\Http\Request;
7
+use Illuminate\Support\Facades\Hash;
8
+
9
+class AdminController extends Controller
10
+{
11
+    public function showLoginForm()
12
+    {
13
+        return view('admin.login');
14
+    }
15
+
16
+    public function login(Request $request)
17
+    {
18
+        $credentials = $request->only('email', 'password');
19
+        $user = User::where('email', $credentials['email'])->first();
20
+        if (!$user || !Hash::check($credentials['password'], $user->password)) {
21
+            return back()->withErrors([
22
+                'email' => 'The provided credentials do not match our records.',
23
+            ]);
24
+        }else{
25
+            auth()->login($user);
26
+            return redirect()->intended('admin/dashboard');
27
+        }
28
+    }
29
+
30
+    public function dashboard()
31
+    {
32
+        return view('admin.dashboard');
33
+    }
34
+}

+ 1
- 0
database/migrations/2014_10_12_000000_create_users_table.php Переглянути файл

@@ -15,6 +15,7 @@ return new class extends Migration
15 15
             $table->id();
16 16
             $table->string('name');
17 17
             $table->string('email')->unique();
18
+            $table->boolean('is_admin')->default(false);
18 19
             $table->timestamp('email_verified_at')->nullable();
19 20
             $table->string('password');
20 21
             $table->rememberToken();

+ 20
- 0
database/seeders/AdminSeeder.php Переглянути файл

@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+namespace Database\Seeders;
4
+
5
+use Illuminate\Database\Seeder;
6
+use Illuminate\Support\Facades\Hash;
7
+use Illuminate\Support\Facades\DB;
8
+
9
+class AdminSeeder extends Seeder
10
+{
11
+    public function run()
12
+    {
13
+        DB::table('users')->insert([
14
+            'name' => 'Admin',
15
+            'email' => 'tech@mirfalah.my',
16
+            'password' => Hash::make('M!rf@lah123'),
17
+            'is_admin' => true,
18
+        ]);
19
+    }
20
+}

+ 1
- 6
database/seeders/DatabaseSeeder.php Переглянути файл

@@ -12,11 +12,6 @@ class DatabaseSeeder extends Seeder
12 12
      */
13 13
     public function run(): void
14 14
     {
15
-        // \App\Models\User::factory(10)->create();
16
-
17
-        // \App\Models\User::factory()->create([
18
-        //     'name' => 'Test User',
19
-        //     'email' => 'test@example.com',
20
-        // ]);
15
+        $this->call(AdminSeeder::class);
21 16
     }
22 17
 }

+ 54
- 0
public/assets/demo/chart-area-demo.js Переглянути файл

@@ -0,0 +1,54 @@
1
+// Set new default font family and font color to mimic Bootstrap's default styling
2
+Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
3
+Chart.defaults.global.defaultFontColor = '#292b2c';
4
+
5
+// Area Chart Example
6
+var ctx = document.getElementById("myAreaChart");
7
+var myLineChart = new Chart(ctx, {
8
+  type: 'line',
9
+  data: {
10
+    labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"],
11
+    datasets: [{
12
+      label: "Sessions",
13
+      lineTension: 0.3,
14
+      backgroundColor: "rgba(2,117,216,0.2)",
15
+      borderColor: "rgba(2,117,216,1)",
16
+      pointRadius: 5,
17
+      pointBackgroundColor: "rgba(2,117,216,1)",
18
+      pointBorderColor: "rgba(255,255,255,0.8)",
19
+      pointHoverRadius: 5,
20
+      pointHoverBackgroundColor: "rgba(2,117,216,1)",
21
+      pointHitRadius: 50,
22
+      pointBorderWidth: 2,
23
+      data: [10000, 30162, 26263, 18394, 18287, 28682, 31274, 33259, 25849, 24159, 32651, 31984, 38451],
24
+    }],
25
+  },
26
+  options: {
27
+    scales: {
28
+      xAxes: [{
29
+        time: {
30
+          unit: 'date'
31
+        },
32
+        gridLines: {
33
+          display: false
34
+        },
35
+        ticks: {
36
+          maxTicksLimit: 7
37
+        }
38
+      }],
39
+      yAxes: [{
40
+        ticks: {
41
+          min: 0,
42
+          max: 40000,
43
+          maxTicksLimit: 5
44
+        },
45
+        gridLines: {
46
+          color: "rgba(0, 0, 0, .125)",
47
+        }
48
+      }],
49
+    },
50
+    legend: {
51
+      display: false
52
+    }
53
+  }
54
+});

+ 46
- 0
public/assets/demo/chart-bar-demo.js Переглянути файл

@@ -0,0 +1,46 @@
1
+// Set new default font family and font color to mimic Bootstrap's default styling
2
+Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
3
+Chart.defaults.global.defaultFontColor = '#292b2c';
4
+
5
+// Bar Chart Example
6
+var ctx = document.getElementById("myBarChart");
7
+var myLineChart = new Chart(ctx, {
8
+  type: 'bar',
9
+  data: {
10
+    labels: ["January", "February", "March", "April", "May", "June"],
11
+    datasets: [{
12
+      label: "Revenue",
13
+      backgroundColor: "rgba(2,117,216,1)",
14
+      borderColor: "rgba(2,117,216,1)",
15
+      data: [4215, 5312, 6251, 7841, 9821, 14984],
16
+    }],
17
+  },
18
+  options: {
19
+    scales: {
20
+      xAxes: [{
21
+        time: {
22
+          unit: 'month'
23
+        },
24
+        gridLines: {
25
+          display: false
26
+        },
27
+        ticks: {
28
+          maxTicksLimit: 6
29
+        }
30
+      }],
31
+      yAxes: [{
32
+        ticks: {
33
+          min: 0,
34
+          max: 15000,
35
+          maxTicksLimit: 5
36
+        },
37
+        gridLines: {
38
+          display: true
39
+        }
40
+      }],
41
+    },
42
+    legend: {
43
+      display: false
44
+    }
45
+  }
46
+});

+ 16
- 0
public/assets/demo/chart-pie-demo.js Переглянути файл

@@ -0,0 +1,16 @@
1
+// Set new default font family and font color to mimic Bootstrap's default styling
2
+Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
3
+Chart.defaults.global.defaultFontColor = '#292b2c';
4
+
5
+// Pie Chart Example
6
+var ctx = document.getElementById("myPieChart");
7
+var myPieChart = new Chart(ctx, {
8
+  type: 'pie',
9
+  data: {
10
+    labels: ["Blue", "Red", "Yellow", "Green"],
11
+    datasets: [{
12
+      data: [12.21, 15.58, 11.25, 8.32],
13
+      backgroundColor: ['#007bff', '#dc3545', '#ffc107', '#28a745'],
14
+    }],
15
+  },
16
+});

+ 4
- 0
public/assets/demo/datatables-demo.js Переглянути файл

@@ -0,0 +1,4 @@
1
+// Call the dataTables jQuery plugin
2
+$(document).ready(function() {
3
+  $('#dataTable').DataTable();
4
+});

+ 1
- 0
public/assets/img/error-404-monochrome.svg
Різницю між файлами не показано, бо вона завелика
Переглянути файл


BIN
public/assets/img/group_21.png Переглянути файл


BIN
public/assets/img/group_22.png Переглянути файл


BIN
public/assets/img/group_29.jpg Переглянути файл


BIN
public/assets/img/path_34.jpg Переглянути файл


BIN
public/assets/img/rectangle_56.jpg Переглянути файл


+ 11243
- 0
public/css/styles.css
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 9
- 0
public/js/datatables-simple-demo.js Переглянути файл

@@ -0,0 +1,9 @@
1
+window.addEventListener('DOMContentLoaded', event => {
2
+    // Simple-DataTables
3
+    // https://github.com/fiduswriter/Simple-DataTables/wiki
4
+
5
+    const datatablesSimple = document.getElementById('datatablesSimple');
6
+    if (datatablesSimple) {
7
+        new simpleDatatables.DataTable(datatablesSimple);
8
+    }
9
+});

+ 26
- 0
public/js/scripts.js Переглянути файл

@@ -0,0 +1,26 @@
1
+/*!
2
+    * Start Bootstrap - SB Admin v7.0.7 (https://startbootstrap.com/template/sb-admin)
3
+    * Copyright 2013-2023 Start Bootstrap
4
+    * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
5
+    */
6
+    // 
7
+// Scripts
8
+// 
9
+
10
+window.addEventListener('DOMContentLoaded', event => {
11
+
12
+    // Toggle the side navigation
13
+    const sidebarToggle = document.body.querySelector('#sidebarToggle');
14
+    if (sidebarToggle) {
15
+        // Uncomment Below to persist sidebar toggle between refreshes
16
+        // if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
17
+        //     document.body.classList.toggle('sb-sidenav-toggled');
18
+        // }
19
+        sidebarToggle.addEventListener('click', event => {
20
+            event.preventDefault();
21
+            document.body.classList.toggle('sb-sidenav-toggled');
22
+            localStorage.setItem('sb|sidebar-toggle', document.body.classList.contains('sb-sidenav-toggled'));
23
+        });
24
+    }
25
+
26
+});

+ 687
- 0
resources/views/admin/dashboard.blade.php Переглянути файл

@@ -0,0 +1,687 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
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, shrink-to-fit=no" />
7
+        <meta name="description" content="" />
8
+        <meta name="author" content="" />
9
+        <title>Dashboard - SB Admin</title>
10
+        <link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
11
+        <link href="css/styles.css" rel="stylesheet" />
12
+        <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
13
+    </head>
14
+    <body class="sb-nav-fixed">
15
+        <nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
16
+            <!-- Navbar Brand-->
17
+            <a class="navbar-brand ps-3" href="index.html">Start Bootstrap</a>
18
+            <!-- Sidebar Toggle-->
19
+            <button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
20
+            <!-- Navbar Search-->
21
+            <form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
22
+                <div class="input-group">
23
+                    <input class="form-control" type="text" placeholder="Search for..." aria-label="Search for..." aria-describedby="btnNavbarSearch" />
24
+                    <button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
25
+                </div>
26
+            </form>
27
+            <!-- Navbar-->
28
+            <ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
29
+                <li class="nav-item dropdown">
30
+                    <a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
31
+                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
32
+                        <li><a class="dropdown-item" href="#!">Settings</a></li>
33
+                        <li><a class="dropdown-item" href="#!">Activity Log</a></li>
34
+                        <li><hr class="dropdown-divider" /></li>
35
+                        <li><a class="dropdown-item" href="#!">Logout</a></li>
36
+                    </ul>
37
+                </li>
38
+            </ul>
39
+        </nav>
40
+        <div id="layoutSidenav">
41
+            <div id="layoutSidenav_nav">
42
+                <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
43
+                    <div class="sb-sidenav-menu">
44
+                        <div class="nav">
45
+                            <div class="sb-sidenav-menu-heading">Core</div>
46
+                            <a class="nav-link" href="index.html">
47
+                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
48
+                                Dashboard
49
+                            </a>
50
+                            <div class="sb-sidenav-menu-heading">Interface</div>
51
+                            <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#collapseLayouts" aria-expanded="false" aria-controls="collapseLayouts">
52
+                                <div class="sb-nav-link-icon"><i class="fas fa-columns"></i></div>
53
+                                Layouts
54
+                                <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
55
+                            </a>
56
+                            <div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
57
+                                <nav class="sb-sidenav-menu-nested nav">
58
+                                    <a class="nav-link" href="layout-static.html">Static Navigation</a>
59
+                                    <a class="nav-link" href="layout-sidenav-light.html">Light Sidenav</a>
60
+                                </nav>
61
+                            </div>
62
+                            <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#collapsePages" aria-expanded="false" aria-controls="collapsePages">
63
+                                <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div>
64
+                                Pages
65
+                                <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
66
+                            </a>
67
+                            <div class="collapse" id="collapsePages" aria-labelledby="headingTwo" data-bs-parent="#sidenavAccordion">
68
+                                <nav class="sb-sidenav-menu-nested nav accordion" id="sidenavAccordionPages">
69
+                                    <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#pagesCollapseAuth" aria-expanded="false" aria-controls="pagesCollapseAuth">
70
+                                        Authentication
71
+                                        <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
72
+                                    </a>
73
+                                    <div class="collapse" id="pagesCollapseAuth" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordionPages">
74
+                                        <nav class="sb-sidenav-menu-nested nav">
75
+                                            <a class="nav-link" href="login.html">Login</a>
76
+                                            <a class="nav-link" href="register.html">Register</a>
77
+                                            <a class="nav-link" href="password.html">Forgot Password</a>
78
+                                        </nav>
79
+                                    </div>
80
+                                    <a class="nav-link collapsed" href="#" data-bs-toggle="collapse" data-bs-target="#pagesCollapseError" aria-expanded="false" aria-controls="pagesCollapseError">
81
+                                        Error
82
+                                        <div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
83
+                                    </a>
84
+                                    <div class="collapse" id="pagesCollapseError" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordionPages">
85
+                                        <nav class="sb-sidenav-menu-nested nav">
86
+                                            <a class="nav-link" href="401.html">401 Page</a>
87
+                                            <a class="nav-link" href="404.html">404 Page</a>
88
+                                            <a class="nav-link" href="500.html">500 Page</a>
89
+                                        </nav>
90
+                                    </div>
91
+                                </nav>
92
+                            </div>
93
+                            <div class="sb-sidenav-menu-heading">Addons</div>
94
+                            <a class="nav-link" href="charts.html">
95
+                                <div class="sb-nav-link-icon"><i class="fas fa-chart-area"></i></div>
96
+                                Charts
97
+                            </a>
98
+                            <a class="nav-link" href="tables.html">
99
+                                <div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
100
+                                Tables
101
+                            </a>
102
+                        </div>
103
+                    </div>
104
+                    <div class="sb-sidenav-footer">
105
+                        <div class="small">Logged in as:</div>
106
+                        Start Bootstrap
107
+                    </div>
108
+                </nav>
109
+            </div>
110
+            <div id="layoutSidenav_content">
111
+                <main>
112
+                    <div class="container-fluid px-4">
113
+                        <h1 class="mt-4">Dashboard</h1>
114
+                        <ol class="breadcrumb mb-4">
115
+                            <li class="breadcrumb-item active">Dashboard</li>
116
+                        </ol>
117
+                        <div class="row">
118
+                            <div class="col-xl-3 col-md-6">
119
+                                <div class="card bg-primary text-white mb-4">
120
+                                    <div class="card-body">Primary Card</div>
121
+                                    <div class="card-footer d-flex align-items-center justify-content-between">
122
+                                        <a class="small text-white stretched-link" href="#">View Details</a>
123
+                                        <div class="small text-white"><i class="fas fa-angle-right"></i></div>
124
+                                    </div>
125
+                                </div>
126
+                            </div>
127
+                            <div class="col-xl-3 col-md-6">
128
+                                <div class="card bg-warning text-white mb-4">
129
+                                    <div class="card-body">Warning Card</div>
130
+                                    <div class="card-footer d-flex align-items-center justify-content-between">
131
+                                        <a class="small text-white stretched-link" href="#">View Details</a>
132
+                                        <div class="small text-white"><i class="fas fa-angle-right"></i></div>
133
+                                    </div>
134
+                                </div>
135
+                            </div>
136
+                            <div class="col-xl-3 col-md-6">
137
+                                <div class="card bg-success text-white mb-4">
138
+                                    <div class="card-body">Success Card</div>
139
+                                    <div class="card-footer d-flex align-items-center justify-content-between">
140
+                                        <a class="small text-white stretched-link" href="#">View Details</a>
141
+                                        <div class="small text-white"><i class="fas fa-angle-right"></i></div>
142
+                                    </div>
143
+                                </div>
144
+                            </div>
145
+                            <div class="col-xl-3 col-md-6">
146
+                                <div class="card bg-danger text-white mb-4">
147
+                                    <div class="card-body">Danger Card</div>
148
+                                    <div class="card-footer d-flex align-items-center justify-content-between">
149
+                                        <a class="small text-white stretched-link" href="#">View Details</a>
150
+                                        <div class="small text-white"><i class="fas fa-angle-right"></i></div>
151
+                                    </div>
152
+                                </div>
153
+                            </div>
154
+                        </div>
155
+                        <div class="row">
156
+                            <div class="col-xl-6">
157
+                                <div class="card mb-4">
158
+                                    <div class="card-header">
159
+                                        <i class="fas fa-chart-area me-1"></i>
160
+                                        Area Chart Example
161
+                                    </div>
162
+                                    <div class="card-body"><canvas id="myAreaChart" width="100%" height="40"></canvas></div>
163
+                                </div>
164
+                            </div>
165
+                            <div class="col-xl-6">
166
+                                <div class="card mb-4">
167
+                                    <div class="card-header">
168
+                                        <i class="fas fa-chart-bar me-1"></i>
169
+                                        Bar Chart Example
170
+                                    </div>
171
+                                    <div class="card-body"><canvas id="myBarChart" width="100%" height="40"></canvas></div>
172
+                                </div>
173
+                            </div>
174
+                        </div>
175
+                        <div class="card mb-4">
176
+                            <div class="card-header">
177
+                                <i class="fas fa-table me-1"></i>
178
+                                DataTable Example
179
+                            </div>
180
+                            <div class="card-body">
181
+                                <table id="datatablesSimple">
182
+                                    <thead>
183
+                                        <tr>
184
+                                            <th>Name</th>
185
+                                            <th>Position</th>
186
+                                            <th>Office</th>
187
+                                            <th>Age</th>
188
+                                            <th>Start date</th>
189
+                                            <th>Salary</th>
190
+                                        </tr>
191
+                                    </thead>
192
+                                    <tfoot>
193
+                                        <tr>
194
+                                            <th>Name</th>
195
+                                            <th>Position</th>
196
+                                            <th>Office</th>
197
+                                            <th>Age</th>
198
+                                            <th>Start date</th>
199
+                                            <th>Salary</th>
200
+                                        </tr>
201
+                                    </tfoot>
202
+                                    <tbody>
203
+                                        <tr>
204
+                                            <td>Tiger Nixon</td>
205
+                                            <td>System Architect</td>
206
+                                            <td>Edinburgh</td>
207
+                                            <td>61</td>
208
+                                            <td>2011/04/25</td>
209
+                                            <td>$320,800</td>
210
+                                        </tr>
211
+                                        <tr>
212
+                                            <td>Garrett Winters</td>
213
+                                            <td>Accountant</td>
214
+                                            <td>Tokyo</td>
215
+                                            <td>63</td>
216
+                                            <td>2011/07/25</td>
217
+                                            <td>$170,750</td>
218
+                                        </tr>
219
+                                        <tr>
220
+                                            <td>Ashton Cox</td>
221
+                                            <td>Junior Technical Author</td>
222
+                                            <td>San Francisco</td>
223
+                                            <td>66</td>
224
+                                            <td>2009/01/12</td>
225
+                                            <td>$86,000</td>
226
+                                        </tr>
227
+                                        <tr>
228
+                                            <td>Cedric Kelly</td>
229
+                                            <td>Senior Javascript Developer</td>
230
+                                            <td>Edinburgh</td>
231
+                                            <td>22</td>
232
+                                            <td>2012/03/29</td>
233
+                                            <td>$433,060</td>
234
+                                        </tr>
235
+                                        <tr>
236
+                                            <td>Airi Satou</td>
237
+                                            <td>Accountant</td>
238
+                                            <td>Tokyo</td>
239
+                                            <td>33</td>
240
+                                            <td>2008/11/28</td>
241
+                                            <td>$162,700</td>
242
+                                        </tr>
243
+                                        <tr>
244
+                                            <td>Brielle Williamson</td>
245
+                                            <td>Integration Specialist</td>
246
+                                            <td>New York</td>
247
+                                            <td>61</td>
248
+                                            <td>2012/12/02</td>
249
+                                            <td>$372,000</td>
250
+                                        </tr>
251
+                                        <tr>
252
+                                            <td>Herrod Chandler</td>
253
+                                            <td>Sales Assistant</td>
254
+                                            <td>San Francisco</td>
255
+                                            <td>59</td>
256
+                                            <td>2012/08/06</td>
257
+                                            <td>$137,500</td>
258
+                                        </tr>
259
+                                        <tr>
260
+                                            <td>Rhona Davidson</td>
261
+                                            <td>Integration Specialist</td>
262
+                                            <td>Tokyo</td>
263
+                                            <td>55</td>
264
+                                            <td>2010/10/14</td>
265
+                                            <td>$327,900</td>
266
+                                        </tr>
267
+                                        <tr>
268
+                                            <td>Colleen Hurst</td>
269
+                                            <td>Javascript Developer</td>
270
+                                            <td>San Francisco</td>
271
+                                            <td>39</td>
272
+                                            <td>2009/09/15</td>
273
+                                            <td>$205,500</td>
274
+                                        </tr>
275
+                                        <tr>
276
+                                            <td>Sonya Frost</td>
277
+                                            <td>Software Engineer</td>
278
+                                            <td>Edinburgh</td>
279
+                                            <td>23</td>
280
+                                            <td>2008/12/13</td>
281
+                                            <td>$103,600</td>
282
+                                        </tr>
283
+                                        <tr>
284
+                                            <td>Jena Gaines</td>
285
+                                            <td>Office Manager</td>
286
+                                            <td>London</td>
287
+                                            <td>30</td>
288
+                                            <td>2008/12/19</td>
289
+                                            <td>$90,560</td>
290
+                                        </tr>
291
+                                        <tr>
292
+                                            <td>Quinn Flynn</td>
293
+                                            <td>Support Lead</td>
294
+                                            <td>Edinburgh</td>
295
+                                            <td>22</td>
296
+                                            <td>2013/03/03</td>
297
+                                            <td>$342,000</td>
298
+                                        </tr>
299
+                                        <tr>
300
+                                            <td>Charde Marshall</td>
301
+                                            <td>Regional Director</td>
302
+                                            <td>San Francisco</td>
303
+                                            <td>36</td>
304
+                                            <td>2008/10/16</td>
305
+                                            <td>$470,600</td>
306
+                                        </tr>
307
+                                        <tr>
308
+                                            <td>Haley Kennedy</td>
309
+                                            <td>Senior Marketing Designer</td>
310
+                                            <td>London</td>
311
+                                            <td>43</td>
312
+                                            <td>2012/12/18</td>
313
+                                            <td>$313,500</td>
314
+                                        </tr>
315
+                                        <tr>
316
+                                            <td>Tatyana Fitzpatrick</td>
317
+                                            <td>Regional Director</td>
318
+                                            <td>London</td>
319
+                                            <td>19</td>
320
+                                            <td>2010/03/17</td>
321
+                                            <td>$385,750</td>
322
+                                        </tr>
323
+                                        <tr>
324
+                                            <td>Michael Silva</td>
325
+                                            <td>Marketing Designer</td>
326
+                                            <td>London</td>
327
+                                            <td>66</td>
328
+                                            <td>2012/11/27</td>
329
+                                            <td>$198,500</td>
330
+                                        </tr>
331
+                                        <tr>
332
+                                            <td>Paul Byrd</td>
333
+                                            <td>Chief Financial Officer (CFO)</td>
334
+                                            <td>New York</td>
335
+                                            <td>64</td>
336
+                                            <td>2010/06/09</td>
337
+                                            <td>$725,000</td>
338
+                                        </tr>
339
+                                        <tr>
340
+                                            <td>Gloria Little</td>
341
+                                            <td>Systems Administrator</td>
342
+                                            <td>New York</td>
343
+                                            <td>59</td>
344
+                                            <td>2009/04/10</td>
345
+                                            <td>$237,500</td>
346
+                                        </tr>
347
+                                        <tr>
348
+                                            <td>Bradley Greer</td>
349
+                                            <td>Software Engineer</td>
350
+                                            <td>London</td>
351
+                                            <td>41</td>
352
+                                            <td>2012/10/13</td>
353
+                                            <td>$132,000</td>
354
+                                        </tr>
355
+                                        <tr>
356
+                                            <td>Dai Rios</td>
357
+                                            <td>Personnel Lead</td>
358
+                                            <td>Edinburgh</td>
359
+                                            <td>35</td>
360
+                                            <td>2012/09/26</td>
361
+                                            <td>$217,500</td>
362
+                                        </tr>
363
+                                        <tr>
364
+                                            <td>Jenette Caldwell</td>
365
+                                            <td>Development Lead</td>
366
+                                            <td>New York</td>
367
+                                            <td>30</td>
368
+                                            <td>2011/09/03</td>
369
+                                            <td>$345,000</td>
370
+                                        </tr>
371
+                                        <tr>
372
+                                            <td>Yuri Berry</td>
373
+                                            <td>Chief Marketing Officer (CMO)</td>
374
+                                            <td>New York</td>
375
+                                            <td>40</td>
376
+                                            <td>2009/06/25</td>
377
+                                            <td>$675,000</td>
378
+                                        </tr>
379
+                                        <tr>
380
+                                            <td>Caesar Vance</td>
381
+                                            <td>Pre-Sales Support</td>
382
+                                            <td>New York</td>
383
+                                            <td>21</td>
384
+                                            <td>2011/12/12</td>
385
+                                            <td>$106,450</td>
386
+                                        </tr>
387
+                                        <tr>
388
+                                            <td>Doris Wilder</td>
389
+                                            <td>Sales Assistant</td>
390
+                                            <td>Sidney</td>
391
+                                            <td>23</td>
392
+                                            <td>2010/09/20</td>
393
+                                            <td>$85,600</td>
394
+                                        </tr>
395
+                                        <tr>
396
+                                            <td>Angelica Ramos</td>
397
+                                            <td>Chief Executive Officer (CEO)</td>
398
+                                            <td>London</td>
399
+                                            <td>47</td>
400
+                                            <td>2009/10/09</td>
401
+                                            <td>$1,200,000</td>
402
+                                        </tr>
403
+                                        <tr>
404
+                                            <td>Gavin Joyce</td>
405
+                                            <td>Developer</td>
406
+                                            <td>Edinburgh</td>
407
+                                            <td>42</td>
408
+                                            <td>2010/12/22</td>
409
+                                            <td>$92,575</td>
410
+                                        </tr>
411
+                                        <tr>
412
+                                            <td>Jennifer Chang</td>
413
+                                            <td>Regional Director</td>
414
+                                            <td>Singapore</td>
415
+                                            <td>28</td>
416
+                                            <td>2010/11/14</td>
417
+                                            <td>$357,650</td>
418
+                                        </tr>
419
+                                        <tr>
420
+                                            <td>Brenden Wagner</td>
421
+                                            <td>Software Engineer</td>
422
+                                            <td>San Francisco</td>
423
+                                            <td>28</td>
424
+                                            <td>2011/06/07</td>
425
+                                            <td>$206,850</td>
426
+                                        </tr>
427
+                                        <tr>
428
+                                            <td>Fiona Green</td>
429
+                                            <td>Chief Operating Officer (COO)</td>
430
+                                            <td>San Francisco</td>
431
+                                            <td>48</td>
432
+                                            <td>2010/03/11</td>
433
+                                            <td>$850,000</td>
434
+                                        </tr>
435
+                                        <tr>
436
+                                            <td>Shou Itou</td>
437
+                                            <td>Regional Marketing</td>
438
+                                            <td>Tokyo</td>
439
+                                            <td>20</td>
440
+                                            <td>2011/08/14</td>
441
+                                            <td>$163,000</td>
442
+                                        </tr>
443
+                                        <tr>
444
+                                            <td>Michelle House</td>
445
+                                            <td>Integration Specialist</td>
446
+                                            <td>Sidney</td>
447
+                                            <td>37</td>
448
+                                            <td>2011/06/02</td>
449
+                                            <td>$95,400</td>
450
+                                        </tr>
451
+                                        <tr>
452
+                                            <td>Suki Burks</td>
453
+                                            <td>Developer</td>
454
+                                            <td>London</td>
455
+                                            <td>53</td>
456
+                                            <td>2009/10/22</td>
457
+                                            <td>$114,500</td>
458
+                                        </tr>
459
+                                        <tr>
460
+                                            <td>Prescott Bartlett</td>
461
+                                            <td>Technical Author</td>
462
+                                            <td>London</td>
463
+                                            <td>27</td>
464
+                                            <td>2011/05/07</td>
465
+                                            <td>$145,000</td>
466
+                                        </tr>
467
+                                        <tr>
468
+                                            <td>Gavin Cortez</td>
469
+                                            <td>Team Leader</td>
470
+                                            <td>San Francisco</td>
471
+                                            <td>22</td>
472
+                                            <td>2008/10/26</td>
473
+                                            <td>$235,500</td>
474
+                                        </tr>
475
+                                        <tr>
476
+                                            <td>Martena Mccray</td>
477
+                                            <td>Post-Sales support</td>
478
+                                            <td>Edinburgh</td>
479
+                                            <td>46</td>
480
+                                            <td>2011/03/09</td>
481
+                                            <td>$324,050</td>
482
+                                        </tr>
483
+                                        <tr>
484
+                                            <td>Unity Butler</td>
485
+                                            <td>Marketing Designer</td>
486
+                                            <td>San Francisco</td>
487
+                                            <td>47</td>
488
+                                            <td>2009/12/09</td>
489
+                                            <td>$85,675</td>
490
+                                        </tr>
491
+                                        <tr>
492
+                                            <td>Howard Hatfield</td>
493
+                                            <td>Office Manager</td>
494
+                                            <td>San Francisco</td>
495
+                                            <td>51</td>
496
+                                            <td>2008/12/16</td>
497
+                                            <td>$164,500</td>
498
+                                        </tr>
499
+                                        <tr>
500
+                                            <td>Hope Fuentes</td>
501
+                                            <td>Secretary</td>
502
+                                            <td>San Francisco</td>
503
+                                            <td>41</td>
504
+                                            <td>2010/02/12</td>
505
+                                            <td>$109,850</td>
506
+                                        </tr>
507
+                                        <tr>
508
+                                            <td>Vivian Harrell</td>
509
+                                            <td>Financial Controller</td>
510
+                                            <td>San Francisco</td>
511
+                                            <td>62</td>
512
+                                            <td>2009/02/14</td>
513
+                                            <td>$452,500</td>
514
+                                        </tr>
515
+                                        <tr>
516
+                                            <td>Timothy Mooney</td>
517
+                                            <td>Office Manager</td>
518
+                                            <td>London</td>
519
+                                            <td>37</td>
520
+                                            <td>2008/12/11</td>
521
+                                            <td>$136,200</td>
522
+                                        </tr>
523
+                                        <tr>
524
+                                            <td>Jackson Bradshaw</td>
525
+                                            <td>Director</td>
526
+                                            <td>New York</td>
527
+                                            <td>65</td>
528
+                                            <td>2008/09/26</td>
529
+                                            <td>$645,750</td>
530
+                                        </tr>
531
+                                        <tr>
532
+                                            <td>Olivia Liang</td>
533
+                                            <td>Support Engineer</td>
534
+                                            <td>Singapore</td>
535
+                                            <td>64</td>
536
+                                            <td>2011/02/03</td>
537
+                                            <td>$234,500</td>
538
+                                        </tr>
539
+                                        <tr>
540
+                                            <td>Bruno Nash</td>
541
+                                            <td>Software Engineer</td>
542
+                                            <td>London</td>
543
+                                            <td>38</td>
544
+                                            <td>2011/05/03</td>
545
+                                            <td>$163,500</td>
546
+                                        </tr>
547
+                                        <tr>
548
+                                            <td>Sakura Yamamoto</td>
549
+                                            <td>Support Engineer</td>
550
+                                            <td>Tokyo</td>
551
+                                            <td>37</td>
552
+                                            <td>2009/08/19</td>
553
+                                            <td>$139,575</td>
554
+                                        </tr>
555
+                                        <tr>
556
+                                            <td>Thor Walton</td>
557
+                                            <td>Developer</td>
558
+                                            <td>New York</td>
559
+                                            <td>61</td>
560
+                                            <td>2013/08/11</td>
561
+                                            <td>$98,540</td>
562
+                                        </tr>
563
+                                        <tr>
564
+                                            <td>Finn Camacho</td>
565
+                                            <td>Support Engineer</td>
566
+                                            <td>San Francisco</td>
567
+                                            <td>47</td>
568
+                                            <td>2009/07/07</td>
569
+                                            <td>$87,500</td>
570
+                                        </tr>
571
+                                        <tr>
572
+                                            <td>Serge Baldwin</td>
573
+                                            <td>Data Coordinator</td>
574
+                                            <td>Singapore</td>
575
+                                            <td>64</td>
576
+                                            <td>2012/04/09</td>
577
+                                            <td>$138,575</td>
578
+                                        </tr>
579
+                                        <tr>
580
+                                            <td>Zenaida Frank</td>
581
+                                            <td>Software Engineer</td>
582
+                                            <td>New York</td>
583
+                                            <td>63</td>
584
+                                            <td>2010/01/04</td>
585
+                                            <td>$125,250</td>
586
+                                        </tr>
587
+                                        <tr>
588
+                                            <td>Zorita Serrano</td>
589
+                                            <td>Software Engineer</td>
590
+                                            <td>San Francisco</td>
591
+                                            <td>56</td>
592
+                                            <td>2012/06/01</td>
593
+                                            <td>$115,000</td>
594
+                                        </tr>
595
+                                        <tr>
596
+                                            <td>Jennifer Acosta</td>
597
+                                            <td>Junior Javascript Developer</td>
598
+                                            <td>Edinburgh</td>
599
+                                            <td>43</td>
600
+                                            <td>2013/02/01</td>
601
+                                            <td>$75,650</td>
602
+                                        </tr>
603
+                                        <tr>
604
+                                            <td>Cara Stevens</td>
605
+                                            <td>Sales Assistant</td>
606
+                                            <td>New York</td>
607
+                                            <td>46</td>
608
+                                            <td>2011/12/06</td>
609
+                                            <td>$145,600</td>
610
+                                        </tr>
611
+                                        <tr>
612
+                                            <td>Hermione Butler</td>
613
+                                            <td>Regional Director</td>
614
+                                            <td>London</td>
615
+                                            <td>47</td>
616
+                                            <td>2011/03/21</td>
617
+                                            <td>$356,250</td>
618
+                                        </tr>
619
+                                        <tr>
620
+                                            <td>Lael Greer</td>
621
+                                            <td>Systems Administrator</td>
622
+                                            <td>London</td>
623
+                                            <td>21</td>
624
+                                            <td>2009/02/27</td>
625
+                                            <td>$103,500</td>
626
+                                        </tr>
627
+                                        <tr>
628
+                                            <td>Jonas Alexander</td>
629
+                                            <td>Developer</td>
630
+                                            <td>San Francisco</td>
631
+                                            <td>30</td>
632
+                                            <td>2010/07/14</td>
633
+                                            <td>$86,500</td>
634
+                                        </tr>
635
+                                        <tr>
636
+                                            <td>Shad Decker</td>
637
+                                            <td>Regional Director</td>
638
+                                            <td>Edinburgh</td>
639
+                                            <td>51</td>
640
+                                            <td>2008/11/13</td>
641
+                                            <td>$183,000</td>
642
+                                        </tr>
643
+                                        <tr>
644
+                                            <td>Michael Bruce</td>
645
+                                            <td>Javascript Developer</td>
646
+                                            <td>Singapore</td>
647
+                                            <td>29</td>
648
+                                            <td>2011/06/27</td>
649
+                                            <td>$183,000</td>
650
+                                        </tr>
651
+                                        <tr>
652
+                                            <td>Donna Snider</td>
653
+                                            <td>Customer Support</td>
654
+                                            <td>New York</td>
655
+                                            <td>27</td>
656
+                                            <td>2011/01/25</td>
657
+                                            <td>$112,000</td>
658
+                                        </tr>
659
+                                    </tbody>
660
+                                </table>
661
+                            </div>
662
+                        </div>
663
+                    </div>
664
+                </main>
665
+                <footer class="py-4 bg-light mt-auto">
666
+                    <div class="container-fluid px-4">
667
+                        <div class="d-flex align-items-center justify-content-between small">
668
+                            <div class="text-muted">Copyright &copy; Your Website 2023</div>
669
+                            <div>
670
+                                <a href="#">Privacy Policy</a>
671
+                                &middot;
672
+                                <a href="#">Terms &amp; Conditions</a>
673
+                            </div>
674
+                        </div>
675
+                    </div>
676
+                </footer>
677
+            </div>
678
+        </div>
679
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
680
+        <script src="js/scripts.js"></script>
681
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
682
+        <script src="assets/demo/chart-area-demo.js"></script>
683
+        <script src="assets/demo/chart-bar-demo.js"></script>
684
+        <script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
685
+        <script src="js/datatables-simple-demo.js"></script>
686
+    </body>
687
+</html>

+ 66
- 0
resources/views/admin/login.blade.php Переглянути файл

@@ -0,0 +1,66 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
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, shrink-to-fit=no" />
7
+        <meta name="description" content="" />
8
+        <meta name="author" content="" />
9
+        <title>Login</title>
10
+        <link href="/css/styles.css" rel="stylesheet" />
11
+        <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
12
+    </head>
13
+    <body class="bg-primary">
14
+        <div id="layoutAuthentication">
15
+            <div id="layoutAuthentication_content">
16
+                <main>
17
+                    <div class="container">
18
+                        <div class="row justify-content-center">
19
+                            <div class="col-lg-5">
20
+                                <div class="card shadow-lg border-0 rounded-lg mt-5">
21
+                                    <div class="card-header"><h3 class="text-center font-weight-light my-4">Login</h3></div>
22
+                                    <div class="card-body">
23
+                                        <form method="POST" action="{{ url('/admin/login') }}">
24
+                                            @csrf
25
+                                            <div class="form-floating mb-3">
26
+                                                <input class="form-control" id="inputEmail" name="email" type="email" placeholder="name@example.com" />
27
+                                                <label for="inputEmail">Email address</label>
28
+                                            </div>
29
+                                            <div class="form-floating mb-3">
30
+                                                <input class="form-control" id="inputPassword" name="password" type="password" placeholder="Password" />
31
+                                                <label for="inputPassword">Password</label>
32
+                                            </div>
33
+                                            <div class="form-check mb-3">
34
+                                                <input class="form-check-input" id="inputRememberPassword" name="remember" type="checkbox" />
35
+                                                <label class="form-check-label" for="inputRememberPassword">Remember Password</label>
36
+                                            </div>
37
+                                            <div class="d-flex align-items-center justify-content-between mt-4 mb-0">
38
+                                                <button class="btn btn-primary" type="submit">Login</button>
39
+                                            </div>
40
+                                        </form>
41
+                                    </div>
42
+                                </div>
43
+                            </div>
44
+                        </div>
45
+                    </div>
46
+                </main>
47
+            </div>
48
+            <div id="layoutAuthentication_footer">
49
+                <footer class="py-4 bg-light mt-auto">
50
+                    <div class="container-fluid px-4">
51
+                        <div class="d-flex align-items-center justify-content-between small">
52
+                            <div class="text-muted">Copyright &copy; Your Website 2023</div>
53
+                            <div>
54
+                                <a href="#">Privacy Policy</a>
55
+                                &middot;
56
+                                <a href="#">Terms &amp; Conditions</a>
57
+                            </div>
58
+                        </div>
59
+                    </div>
60
+                </footer>
61
+            </div>
62
+        </div>
63
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
64
+        <script src="/js/scripts.js"></script>
65
+    </body>
66
+</html>

+ 6
- 0
routes/web.php Переглянути файл

@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 
3
+use App\Http\Controllers\AdminController;
3 4
 use Illuminate\Support\Facades\Route;
4 5
 
5 6
 /*
@@ -16,3 +17,8 @@ use Illuminate\Support\Facades\Route;
16 17
 // Route::statamic('example', 'example-view', [
17 18
 //    'title' => 'Example'
18 19
 // ]);
20
+
21
+Route::get('/admin/login', [AdminController::class, 'showLoginForm'])->name('admin.login');
22
+Route::post('/admin/login', [AdminController::class, 'login']);
23
+
24
+Route::get('/admin/dashboard', [AdminController::class, 'dashboard'])->name('admin.dashboard');

Завантаження…
Відмінити
Зберегти