dashboard
This commit is contained in:
parent
374c277022
commit
e7f5f582e6
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('dashboard');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,43 @@
|
|||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
{{ __('Dashboard') }}
|
||||
<h1>Selamat datang, {{ Auth::user()->name }}!</h1>
|
||||
</h2>
|
||||
</x-slot>
|
||||
@extends('layouts.app')
|
||||
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
|
||||
<x-welcome />
|
||||
@section('content')
|
||||
<h2 class="mb-4">Dashboard Admin</h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="card text-white bg-primary mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Guru</h5>
|
||||
<p class="card-text fs-3">{{ $guruCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card text-white bg-success mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Wali Murid</h5>
|
||||
<p class="card-text fs-3">{{ $waliCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card text-white bg-warning mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Kelas</h5>
|
||||
<p class="card-text fs-3">{{ $kelasCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card text-white bg-danger mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Siswa</h5>
|
||||
<p class="card-text fs-3">{{ $siswaCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>PAUD Monitoring - Dashboard</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
}
|
||||
.sidebar {
|
||||
width: 220px;
|
||||
min-height: 100vh;
|
||||
background: #2c3e50;
|
||||
color: white;
|
||||
padding: 20px 10px;
|
||||
}
|
||||
.sidebar a {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
margin: 5px 0;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
background: #34495e;
|
||||
}
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
background: #f5f6fa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar">
|
||||
<h4 class="text-center">Admin</h4>
|
||||
<hr>
|
||||
<a href="{{ route('dashboard') }}">📊 Dashboard</a>
|
||||
<a href="#">👩🏫 Guru</a>
|
||||
<a href="#">👨👩👧 Wali Murid</a>
|
||||
<a href="#">🏫 Kelas</a>
|
||||
<a href="#">👧👦 Siswa</a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger w-100 mt-3">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
@yield('content')
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\DashboardController;
|
||||
|
||||
Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
|
||||
Route::post('/login', [AuthController::class, 'login']);
|
||||
|
|
@ -10,9 +11,7 @@
|
|||
Route::get('/', function () {
|
||||
return view('splash'); // tampilan splash screen
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
});
|
||||
});
|
||||
Route::get('/dashboard', [DashboardController::class, 'index'])
|
||||
->middleware('auth')
|
||||
->name('dashboard');
|
||||
});
|
||||
Loading…
Reference in New Issue