first commit
This commit is contained in:
commit
1047448209
|
|
@ -0,0 +1,18 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[compose.yaml]
|
||||
indent_size = 4
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
# APP_MAINTENANCE_STORE=database
|
||||
|
||||
# PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
# CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
*.log
|
||||
.DS_Store
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
/.fleet
|
||||
/.idea
|
||||
/.nova
|
||||
/.phpunit.cache
|
||||
/.vscode
|
||||
/.zed
|
||||
/auth.json
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/storage/pail
|
||||
/vendor
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
Thumbs.db
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Redberry](https://redberry.international/laravel-development)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Pasien;
|
||||
use App\Models\Diagnosa;
|
||||
use App\Models\Penyakit;
|
||||
use App\Models\Gejala;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// STATISTIK
|
||||
$totalPasien = Pasien::count();
|
||||
$totalDiagnosa = Diagnosa::count();
|
||||
$totalPenyakit = Penyakit::count();
|
||||
$totalGejala = Gejala::count();
|
||||
|
||||
// DATA CHART
|
||||
$chart = Diagnosa::selectRaw('penyakit_id, COUNT(*) as total')
|
||||
->groupBy('penyakit_id')
|
||||
->with('penyakit')
|
||||
->get();
|
||||
|
||||
return view('admin.dashboard', compact(
|
||||
'totalPasien',
|
||||
'totalDiagnosa',
|
||||
'totalPenyakit',
|
||||
'totalGejala',
|
||||
'chart'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Redirect default (tidak terlalu dipakai lagi)
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
$this->middleware('auth')->only('logout');
|
||||
}
|
||||
|
||||
/**
|
||||
* ✅ REDIRECT SETELAH LOGIN (ROLE BASED)
|
||||
*/
|
||||
protected function authenticated(Request $request, $user)
|
||||
{
|
||||
if ($user->role === 'admin') {
|
||||
return redirect('/admin/dashboard');
|
||||
}
|
||||
|
||||
return redirect('/user/dashboard');
|
||||
}
|
||||
|
||||
/**
|
||||
* ✅ REDIRECT SETELAH LOGOUT
|
||||
*/
|
||||
protected function loggedOut(Request $request)
|
||||
{
|
||||
return redirect('/login');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\Models\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, ValidatesRequests;
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use App\Models\Gejala;
|
||||
use App\Models\Rule;
|
||||
use App\Models\Pasien;
|
||||
use App\Models\Diagnosa;
|
||||
use App\Models\Penyakit;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DiagnosaController extends Controller
|
||||
{
|
||||
|
||||
|
||||
// FORM DIAGNOSA
|
||||
|
||||
public function index()
|
||||
{
|
||||
$gejalas = Gejala::all();
|
||||
return view('user.diagnosa', compact('gejalas'));
|
||||
}
|
||||
|
||||
|
||||
// PROSES CF KOMBINASI + CF USER
|
||||
|
||||
public function proses(Request $request)
|
||||
{
|
||||
// validasi minimal 1 gejala dipilih
|
||||
if (empty(array_filter($request->gejala ?? []))) {
|
||||
return back()->with('error', 'Pilih minimal 1 gejala!');
|
||||
}
|
||||
|
||||
// ambil input (format: [gejala_id => nilai_cf_user])
|
||||
$inputGejala = array_filter($request->gejala);
|
||||
|
||||
|
||||
// ambil rule sesuai gejala yang dipilih
|
||||
$rules = Rule::whereIn('gejala_id', array_keys($inputGejala))->get();
|
||||
|
||||
$hasil = [];
|
||||
|
||||
foreach ($rules as $rule) {
|
||||
|
||||
// CF dari pakar
|
||||
$cf_pakar = $rule->mb - $rule->md;
|
||||
|
||||
// CF dari user
|
||||
$cf_user = $inputGejala[$rule->gejala_id];
|
||||
|
||||
// CF akhir
|
||||
$cf = $cf_pakar * $cf_user;
|
||||
|
||||
if (!isset($hasil[$rule->penyakit_id])) {
|
||||
$hasil[$rule->penyakit_id] = $cf;
|
||||
} else {
|
||||
// CF KOMBINASI
|
||||
$hasil[$rule->penyakit_id] =
|
||||
$hasil[$rule->penyakit_id] +
|
||||
($cf * (1 - $hasil[$rule->penyakit_id]));
|
||||
}
|
||||
}
|
||||
|
||||
// jika tidak ada hasil
|
||||
if (empty($hasil)) {
|
||||
return back()->with('error', 'Tidak ada rule yang cocok!');
|
||||
}
|
||||
|
||||
// ambil hasil tertinggi
|
||||
arsort($hasil);
|
||||
$penyakit_id = array_key_first($hasil);
|
||||
$cf_hasil = $hasil[$penyakit_id];
|
||||
|
||||
$pasien = Pasien::where('user_id', Auth::id())->latest()->first();
|
||||
|
||||
// simpan ke DB
|
||||
$diagnosa = Diagnosa::create([
|
||||
'pasien_id' => $pasien->id,
|
||||
'penyakit_id' => $penyakit_id,
|
||||
'cf_hasil' => $cf_hasil,
|
||||
'gejala_dipilih' => json_encode($inputGejala)
|
||||
]);
|
||||
|
||||
return redirect()->route('diagnosa.hasil', $diagnosa->id);
|
||||
}
|
||||
|
||||
|
||||
// HASIL DIAGNOSA
|
||||
|
||||
public function hasil($id)
|
||||
{
|
||||
$diagnosa = Diagnosa::with(['pasien', 'penyakit'])->findOrFail($id);
|
||||
|
||||
// ROLE
|
||||
if (auth()->user()->role == 'admin') {
|
||||
return view('admin.hasil', compact('diagnosa'));
|
||||
}
|
||||
|
||||
return view('user.hasil', compact('diagnosa'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// CETAK PDF
|
||||
// =========================
|
||||
public function pdf($id)
|
||||
{
|
||||
$diagnosa = Diagnosa::with(['pasien','penyakit'])->findOrFail($id);
|
||||
|
||||
// ✅ ambil data gejala (id => cf_user)
|
||||
$gejalaData = json_decode($diagnosa->gejala_dipilih, true) ?? [];
|
||||
|
||||
// ✅ ambil hanya ID
|
||||
$gejalaIds = array_keys($gejalaData);
|
||||
|
||||
// ✅ ambil data gejala dari DB
|
||||
$gejalas = Gejala::whereIn('id', $gejalaIds)->get();
|
||||
|
||||
$pdf = Pdf::loadView('pdf.diagnosa', compact('diagnosa','gejalas'));
|
||||
|
||||
return $pdf->download('hasil_diagnosa_'.$diagnosa->id.'.pdf');
|
||||
}
|
||||
|
||||
|
||||
// =========================
|
||||
// RIWAYAT USER
|
||||
// =========================
|
||||
public function riwayat()
|
||||
{
|
||||
$pasien = Pasien::where('user_id', Auth::id())->first();
|
||||
|
||||
// jumlah data per halaman
|
||||
$perPage = request()->perPage ?? 5;
|
||||
|
||||
// jika belum isi data diri
|
||||
if (!$pasien) {
|
||||
|
||||
$data = Diagnosa::where('id', 0)
|
||||
->paginate($perPage);
|
||||
|
||||
return view('user.riwayat', compact('data', 'perPage'));
|
||||
}
|
||||
|
||||
$data = Diagnosa::with(['penyakit', 'pasien'])
|
||||
->where('pasien_id', $pasien->id)
|
||||
->latest()
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('user.riwayat', compact('data', 'perPage'));
|
||||
}
|
||||
|
||||
|
||||
public function dashboard(Request $request)
|
||||
{
|
||||
$pasien = \App\Models\Pasien::where('user_id', auth()->id())->first();
|
||||
|
||||
$perPage = $request->perPage ?? 5; // default 5
|
||||
|
||||
$totalDiagnosa = 0;
|
||||
$lastDiagnosa = null;
|
||||
$riwayat = collect();
|
||||
|
||||
if ($pasien) {
|
||||
$riwayat = \App\Models\Diagnosa::with('penyakit')
|
||||
->where('pasien_id', $pasien->id)
|
||||
->latest()
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
$totalDiagnosa = \App\Models\Diagnosa::where('pasien_id', $pasien->id)->count();
|
||||
$lastDiagnosa = \App\Models\Diagnosa::where('pasien_id', $pasien->id)->latest()->first();
|
||||
}
|
||||
|
||||
return view('user.dashboard', compact(
|
||||
'totalDiagnosa',
|
||||
'lastDiagnosa',
|
||||
'riwayat',
|
||||
'perPage'
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Edukasi;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EdukasiController extends Controller
|
||||
{
|
||||
// =========================
|
||||
// ADMIN - LIST DATA
|
||||
// =========================
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$query = Edukasi::query();
|
||||
|
||||
// SEARCH
|
||||
if ($request->search) {
|
||||
|
||||
$query->where('judul', 'like', '%' . $request->search . '%')
|
||||
->orWhere('isi', 'like', '%' . $request->search . '%');
|
||||
|
||||
}
|
||||
|
||||
// jumlah data per halaman
|
||||
$perPage = $request->perPage ?? 5;
|
||||
|
||||
// pagination
|
||||
$edukasis = $query->latest()
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('admin.edukasi.index', compact(
|
||||
'edukasis',
|
||||
'perPage'
|
||||
));
|
||||
}
|
||||
// =========================
|
||||
// ADMIN - FORM CREATE
|
||||
// =========================
|
||||
public function create()
|
||||
{
|
||||
return view('admin.edukasi.create');
|
||||
}
|
||||
|
||||
// =========================
|
||||
// ADMIN - SIMPAN DATA
|
||||
// =========================
|
||||
public function store(Request $request)
|
||||
{
|
||||
// VALIDASI
|
||||
$request->validate([
|
||||
'judul' => 'required|string|max:255',
|
||||
'isi' => 'required',
|
||||
]);
|
||||
|
||||
// SIMPAN DATA
|
||||
$data = [
|
||||
'judul' => $request->judul,
|
||||
'isi' => $request->isi,
|
||||
];
|
||||
|
||||
$data = $request->all();
|
||||
|
||||
if ($request->hasFile('gambar')) {
|
||||
$file = $request->file('gambar');
|
||||
$namaFile = time() . '.' . $file->getClientOriginalExtension();
|
||||
$file->move(public_path('uploads'), $namaFile);
|
||||
|
||||
$data['gambar'] = $namaFile;
|
||||
}
|
||||
|
||||
Edukasi::create($data);
|
||||
|
||||
return redirect()->route('edukasi.index')
|
||||
->with('success', 'Data edukasi berhasil ditambahkan');
|
||||
}
|
||||
|
||||
// =========================
|
||||
// ADMIN - FORM EDIT
|
||||
// =========================
|
||||
public function edit($id)
|
||||
{
|
||||
$edukasi = Edukasi::findOrFail($id);
|
||||
return view('admin.edukasi.edit', compact('edukasi'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// ADMIN - UPDATE DATA
|
||||
// =========================
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// VALIDASI
|
||||
$request->validate([
|
||||
'judul' => 'required|string|max:255',
|
||||
'isi' => 'required',
|
||||
]);
|
||||
|
||||
// UPDATE
|
||||
$edukasi = Edukasi::findOrFail($id);
|
||||
$data = [
|
||||
'judul' => $request->judul,
|
||||
'isi' => $request->isi,
|
||||
];
|
||||
|
||||
$edukasi = Edukasi::findOrFail($id);
|
||||
$data = $request->all();
|
||||
|
||||
if ($request->hasFile('gambar')) {
|
||||
$file = $request->file('gambar');
|
||||
$namaFile = time() . '.' . $file->getClientOriginalExtension();
|
||||
$file->move(public_path('uploads'), $namaFile);
|
||||
|
||||
$data['gambar'] = $namaFile;
|
||||
}
|
||||
|
||||
$edukasi->update($data);
|
||||
|
||||
|
||||
return redirect()->route('edukasi.index')
|
||||
->with('success', 'Data edukasi berhasil diupdate');
|
||||
}
|
||||
|
||||
// =========================
|
||||
// ADMIN - DELETE DATA
|
||||
// =========================
|
||||
public function destroy($id)
|
||||
{
|
||||
Edukasi::destroy($id);
|
||||
|
||||
return back()->with('success', 'Data edukasi berhasil dihapus');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$edukasi = Edukasi::findOrFail($id);
|
||||
return view('admin.edukasi.show', compact('edukasi'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// USER - TAMPILKAN EDUKASI
|
||||
// =========================
|
||||
|
||||
|
||||
public function userIndex(Request $request)
|
||||
{
|
||||
$query = Edukasi::query();
|
||||
|
||||
// 🔍 SEARCH
|
||||
if ($request->search) {
|
||||
$query->where('judul', 'like', '%' . $request->search . '%')
|
||||
->orWhere('isi', 'like', '%' . $request->search . '%');
|
||||
}
|
||||
|
||||
$edukasis = $query->latest()->get();
|
||||
|
||||
return view('user.edukasi', compact('edukasis'));
|
||||
}
|
||||
|
||||
public function showUser($id)
|
||||
{
|
||||
$edukasi = Edukasi::findOrFail($id);
|
||||
return view('user.edukasi_detail', compact('edukasi'));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Gejala;
|
||||
|
||||
class GejalaController extends Controller
|
||||
{
|
||||
// TAMPIL DATA
|
||||
public function index(Request $request)
|
||||
{
|
||||
// jumlah data per halaman
|
||||
$perPage = $request->perPage ?? 5;
|
||||
|
||||
// search
|
||||
$query = Gejala::query();
|
||||
|
||||
if ($request->search) {
|
||||
|
||||
$query->where('kode', 'like', '%' . $request->search . '%')
|
||||
->orWhere('nama', 'like', '%' . $request->search . '%');
|
||||
}
|
||||
|
||||
// pagination
|
||||
$gejalas = $query->orderBy('kode', 'asc')
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('admin.gejala.index', compact('gejalas', 'perPage'));
|
||||
}
|
||||
|
||||
// FORM TAMBAH
|
||||
public function create()
|
||||
{
|
||||
// ambil kode terakhir
|
||||
$lastGejala = Gejala::orderBy('kode', 'desc')->first();
|
||||
|
||||
// default awal
|
||||
$kode = 'G01';
|
||||
|
||||
// jika ada data
|
||||
if ($lastGejala) {
|
||||
|
||||
// ambil angka dari kode
|
||||
$lastNumber = (int) substr($lastGejala->kode, 1);
|
||||
|
||||
// tambah 1
|
||||
$newNumber = $lastNumber + 1;
|
||||
|
||||
// format jadi G01
|
||||
$kode = 'G' . str_pad($newNumber, 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
return view('admin.gejala.create', compact('kode'));
|
||||
}
|
||||
|
||||
// SIMPAN DATA
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'kode' => 'required|unique:gejalas',
|
||||
'nama' => 'required'
|
||||
]);
|
||||
|
||||
Gejala::create($request->all());
|
||||
|
||||
return redirect()->route('gejala.index')
|
||||
->with('success', 'Data berhasil ditambahkan');
|
||||
}
|
||||
|
||||
// FORM EDIT
|
||||
public function edit($id)
|
||||
{
|
||||
$gejala = Gejala::findOrFail($id);
|
||||
return view('admin.gejala.edit', compact('gejala'));
|
||||
}
|
||||
|
||||
// UPDATE
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$gejala = Gejala::findOrFail($id);
|
||||
|
||||
$request->validate([
|
||||
'kode' => 'required|unique:gejalas,kode,' . $id,
|
||||
'nama' => 'required'
|
||||
]);
|
||||
|
||||
$gejala->update([
|
||||
'nama' => $request->nama]);
|
||||
|
||||
return redirect()->route('gejala.index')
|
||||
->with('success', 'Data berhasil diupdate');
|
||||
}
|
||||
|
||||
// HAPUS
|
||||
public function destroy($id)
|
||||
{
|
||||
Gejala::destroy($id);
|
||||
|
||||
return redirect()->route('gejala.index')
|
||||
->with('success', 'Data berhasil dihapus');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (auth()->user()->role == 'admin') {
|
||||
return redirect('/admin/dashboard');
|
||||
} else {
|
||||
return redirect('/user/dashboard');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Pasien;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class PasienController extends Controller
|
||||
{
|
||||
// FORM INPUT
|
||||
public function create()
|
||||
{
|
||||
return view('user.pasien.create');
|
||||
}
|
||||
|
||||
// SIMPAN DATA
|
||||
public function store(Request $request)
|
||||
{
|
||||
Pasien::create([
|
||||
'nama' => $request->nama,
|
||||
'jenis_kelamin' => $request->jenis_kelamin,
|
||||
'tempat_lahir' => $request->tempat_lahir,
|
||||
'tanggal_lahir' => $request->tanggal_lahir,
|
||||
'alamat' => $request->alamat,
|
||||
'no_telp' => $request->no_telp,
|
||||
'user_id' => Auth::id(),
|
||||
]);
|
||||
|
||||
return redirect()->route('user.diagnosa');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Penyakit;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PenyakitController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
// jumlah data
|
||||
$perPage = $request->perPage ?? 5;
|
||||
|
||||
$query = Penyakit::query();
|
||||
|
||||
// SEARCH
|
||||
if ($request->search) {
|
||||
|
||||
$query->where('kode', 'like', '%' . $request->search . '%')
|
||||
->orWhere('nama', 'like', '%' . $request->search . '%');
|
||||
}
|
||||
|
||||
// PAGINATION + URUT KODE
|
||||
$penyakits = $query->orderBy('kode', 'asc')
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('admin.penyakit.index', compact('penyakits', 'perPage'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// ambil kode terakhir
|
||||
$lastPenyakit = Penyakit::orderBy('kode', 'desc')->first();
|
||||
|
||||
// default awal
|
||||
$kode = 'P01';
|
||||
|
||||
// jika ada data
|
||||
if ($lastPenyakit) {
|
||||
|
||||
// ambil angka dari kode
|
||||
$lastNumber = (int) substr($lastPenyakit->kode, 1);
|
||||
|
||||
// tambah 1
|
||||
$newNumber = $lastNumber + 1;
|
||||
|
||||
// format P01
|
||||
$kode = 'P' . str_pad($newNumber, 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
return view('admin.penyakit.create', compact('kode'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'kode' => 'required|unique:penyakits',
|
||||
'nama' => 'required'
|
||||
]);
|
||||
|
||||
Penyakit::create($request->all());
|
||||
|
||||
return redirect()->route('penyakit.index')
|
||||
->with('success', 'Data berhasil ditambahkan');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$penyakit = Penyakit::findOrFail($id);
|
||||
return view('admin.penyakit.edit', compact('penyakit'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Penyakit $penyakit)
|
||||
{
|
||||
$request->validate([
|
||||
'nama' => 'required'
|
||||
]);
|
||||
|
||||
$penyakit->update([
|
||||
'nama' => $request->nama
|
||||
]);
|
||||
|
||||
return redirect()->route('penyakit.index')
|
||||
->with('success', 'Data penyakit berhasil diupdate');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Penyakit::destroy($id);
|
||||
|
||||
return redirect()->route('penyakit.index')
|
||||
->with('success', 'Data berhasil dihapus');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Rule;
|
||||
use App\Models\Gejala;
|
||||
use App\Models\Penyakit;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RuleController extends Controller
|
||||
{
|
||||
// =========================
|
||||
// LIST DATA
|
||||
// =========================
|
||||
public function index(Request $request)
|
||||
{
|
||||
// jumlah data per halaman
|
||||
$perPage = $request->perPage ?? 5;
|
||||
|
||||
$query = Rule::with(['gejala', 'penyakit']);
|
||||
|
||||
// SEARCH
|
||||
if ($request->search) {
|
||||
|
||||
$query->whereHas('gejala', function ($q) use ($request) {
|
||||
|
||||
$q->where('nama', 'like', '%' . $request->search . '%');
|
||||
|
||||
})->orWhereHas('penyakit', function ($q) use ($request) {
|
||||
|
||||
$q->where('nama', 'like', '%' . $request->search . '%');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// pagination
|
||||
$rules = $query->latest()
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('admin.rule.index', compact('rules', 'perPage'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// FORM CREATE
|
||||
// =========================
|
||||
public function create()
|
||||
{
|
||||
$gejalas = Gejala::all();
|
||||
$penyakits = Penyakit::all();
|
||||
|
||||
return view('admin.rule.create', compact('gejalas', 'penyakits'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// SIMPAN DATA
|
||||
// =========================
|
||||
public function store(Request $request)
|
||||
{
|
||||
// ✅ VALIDASI
|
||||
$request->validate([
|
||||
'gejala_id' => 'required',
|
||||
'penyakit_id' => 'required',
|
||||
'mb' => 'required|numeric|min:0|max:1',
|
||||
'md' => 'required|numeric|min:0|max:1',
|
||||
]);
|
||||
|
||||
// ❗ CEK LOGIKA CF
|
||||
if ($request->md > $request->mb) {
|
||||
return back()->with('error', 'MD tidak boleh lebih besar dari MB');
|
||||
}
|
||||
|
||||
// ✅ AUTO GENERATE KODE
|
||||
$last = Rule::latest()->first();
|
||||
$kode = 'R' . str_pad(($last ? $last->id + 1 : 1), 2, '0', STR_PAD_LEFT);
|
||||
|
||||
// ✅ HITUNG CF
|
||||
$cf = $request->mb - $request->md;
|
||||
|
||||
// ✅ SIMPAN
|
||||
Rule::create([
|
||||
'kode' => $kode,
|
||||
'gejala_id' => $request->gejala_id,
|
||||
'penyakit_id' => $request->penyakit_id,
|
||||
'mb' => $request->mb,
|
||||
'md' => $request->md,
|
||||
'cf' => $cf
|
||||
]);
|
||||
|
||||
return redirect()->route('rule.index')
|
||||
->with('success', 'Rule berhasil ditambahkan');
|
||||
}
|
||||
|
||||
// =========================
|
||||
// FORM EDIT
|
||||
// =========================
|
||||
public function edit($id)
|
||||
{
|
||||
$rule = Rule::findOrFail($id);
|
||||
$gejalas = Gejala::all();
|
||||
$penyakits = Penyakit::all();
|
||||
|
||||
return view('admin.rule.edit', compact('rule', 'gejalas', 'penyakits'));
|
||||
}
|
||||
|
||||
// =========================
|
||||
// UPDATE DATA
|
||||
// =========================
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// ✅ VALIDASI
|
||||
$request->validate([
|
||||
'gejala_id' => 'required',
|
||||
'penyakit_id' => 'required',
|
||||
'mb' => 'required|numeric|min:0|max:1',
|
||||
'md' => 'required|numeric|min:0|max:1',
|
||||
]);
|
||||
|
||||
if ($request->md > $request->mb) {
|
||||
return back()->with('error', 'MD tidak boleh lebih besar dari MB');
|
||||
}
|
||||
|
||||
$rule = Rule::findOrFail($id);
|
||||
|
||||
// ✅ HITUNG CF
|
||||
$cf = $request->mb - $request->md;
|
||||
|
||||
$rule->update([
|
||||
'gejala_id' => $request->gejala_id,
|
||||
'penyakit_id' => $request->penyakit_id,
|
||||
'mb' => $request->mb,
|
||||
'md' => $request->md,
|
||||
'cf' => $cf
|
||||
]);
|
||||
|
||||
return redirect()->route('rule.index')
|
||||
->with('success', 'Rule berhasil diupdate');
|
||||
}
|
||||
|
||||
// =========================
|
||||
// DELETE
|
||||
// =========================
|
||||
public function destroy($id)
|
||||
{
|
||||
Rule::destroy($id);
|
||||
|
||||
return back()->with('success', 'Rule berhasil dihapus');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Diagnosa;
|
||||
use App\Models\Pasien;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class UserDashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$pasien = Pasien::where('user_id', Auth::id())->first();
|
||||
|
||||
// default kosong
|
||||
$totalDiagnosa = 0;
|
||||
$lastDiagnosa = null;
|
||||
|
||||
// pagination
|
||||
$perPage = request()->perPage ?? 5;
|
||||
|
||||
// jika pasien belum ada
|
||||
if (!$pasien) {
|
||||
|
||||
$riwayat = Diagnosa::where('id', 0)->paginate($perPage);
|
||||
|
||||
return view('user.dashboard', compact(
|
||||
'totalDiagnosa',
|
||||
'lastDiagnosa',
|
||||
'riwayat',
|
||||
'perPage'
|
||||
));
|
||||
}
|
||||
|
||||
// total diagnosa
|
||||
$totalDiagnosa = Diagnosa::where('pasien_id', $pasien->id)->count();
|
||||
|
||||
// diagnosa terakhir
|
||||
$lastDiagnosa = Diagnosa::with('penyakit')
|
||||
->where('pasien_id', $pasien->id)
|
||||
->latest()
|
||||
->first();
|
||||
|
||||
// riwayat
|
||||
$riwayat = Diagnosa::with('penyakit')
|
||||
->where('pasien_id', $pasien->id)
|
||||
->latest()
|
||||
->paginate($perPage)
|
||||
->withQueryString();
|
||||
|
||||
return view('user.dashboard', compact(
|
||||
'totalDiagnosa',
|
||||
'lastDiagnosa',
|
||||
'riwayat',
|
||||
'perPage'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Diagnosa extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'pasien_id',
|
||||
'penyakit_id',
|
||||
'cf_hasil',
|
||||
'gejala_dipilih'
|
||||
];
|
||||
|
||||
public function pasien()
|
||||
{
|
||||
return $this->belongsTo(Pasien::class);
|
||||
}
|
||||
|
||||
public function penyakit()
|
||||
{
|
||||
return $this->belongsTo(Penyakit::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Edukasi extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'judul',
|
||||
'isi',
|
||||
'gambar'
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Gejala extends Model
|
||||
{
|
||||
protected $fillable = ['kode', 'nama'];
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Pasien extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'nama',
|
||||
'jenis_kelamin',
|
||||
'tempat_lahir',
|
||||
'tanggal_lahir',
|
||||
'alamat',
|
||||
'no_telp',
|
||||
'user_id'
|
||||
];
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Penyakit extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'kode',
|
||||
'nama',
|
||||
'deskripsi',
|
||||
'solusi',
|
||||
'komplikasi'
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Rule extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'kode',
|
||||
'gejala_id',
|
||||
'penyakit_id',
|
||||
'mb',
|
||||
'md'
|
||||
];
|
||||
|
||||
public function gejala()
|
||||
{
|
||||
return $this->belongsTo(Gejala::class);
|
||||
}
|
||||
|
||||
public function penyakit()
|
||||
{
|
||||
return $this->belongsTo(Penyakit::class);
|
||||
}
|
||||
|
||||
// Hitung Nilai CF
|
||||
public function getCfAttribute()
|
||||
{
|
||||
return $this->mb - $this->md;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Paginator::useBootstrap();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the command...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
$status = $app->handleCommand(new ArgvInput);
|
||||
|
||||
exit($status);
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
})->create();
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
];
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"barryvdh/laravel-dompdf": "^3.1",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"laravel/ui": "^4.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.24",
|
||||
"laravel/sail": "^1.41",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"phpunit/phpunit": "^11.5.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"setup": [
|
||||
"composer install",
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan key:generate",
|
||||
"@php artisan migrate --force",
|
||||
"npm install",
|
||||
"npm run build"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
||||
],
|
||||
"test": [
|
||||
"@php artisan config:clear --ansi",
|
||||
"@php artisan test"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi",
|
||||
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||
"@php artisan migrate --graceful --ansi"
|
||||
],
|
||||
"pre-package-uninstall": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application, which will be used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| other UI elements where an application name needs to be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the "environment" your application is currently
|
||||
| running in. This may determine how you prefer to configure various
|
||||
| services the application utilizes. Set this in your ".env" file.
|
||||
|
|
||||
*/
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| the application so that it's available within Artisan commands.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. The timezone
|
||||
| is set to "UTC" by default as it is suitable for most use cases.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by Laravel's translation / localization methods. This option can be
|
||||
| set to any locale for which you plan to have translation strings.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => env('APP_LOCALE', 'en'),
|
||||
|
||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||
|
||||
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is utilized by Laravel's encryption services and should be set
|
||||
| to a random, 32 character string to ensure that all encrypted values
|
||||
| are secure. You should do this prior to deploying the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options determine the driver used to determine and
|
||||
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||
| allow maintenance mode to be controlled across multiple machines.
|
||||
|
|
||||
| Supported drivers: "file", "cache"
|
||||
|
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default authentication "guard" and password
|
||||
| reset "broker" for your application. You may change these values
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => env('AUTH_GUARD', 'web'),
|
||||
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| which utilizes session storage plus the Eloquent user provider.
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| providers to represent the model / table. These providers may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => env('AUTH_MODEL', App\Models\User::class),
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options specify the behavior of Laravel's password
|
||||
| reset functionality, including the table utilized for token storage
|
||||
| and the user provider that is invoked to actually retrieve users.
|
||||
|
|
||||
| The expiry time is the number of minutes that each reset token will be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
| The throttle setting is the number of seconds a user must wait before
|
||||
| generating more password reset tokens. This prevents the user from
|
||||
| quickly generating a very large amount of password reset tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the number of seconds before a password confirmation
|
||||
| window expires and users are asked to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache store that will be used by the
|
||||
| framework. This connection is utilized if another isn't explicitly
|
||||
| specified when running a cache operation inside the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_STORE', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "array", "database", "file", "memcached",
|
||||
| "redis", "dynamodb", "octane",
|
||||
| "failover", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_CACHE_CONNECTION'),
|
||||
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
'lock_path' => storage_path('framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
|
||||
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'driver' => 'failover',
|
||||
'stores' => [
|
||||
'database',
|
||||
'array',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
|
||||
| stores, there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'),
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for database operations. This is
|
||||
| the connection which will be utilized unless another connection
|
||||
| is explicitly specified when you execute a query / statement.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below are all of the database connections defined for your application.
|
||||
| An example configuration is provided for each database system which
|
||||
| is supported by Laravel. You're free to add / remove connections.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DB_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
'busy_timeout' => null,
|
||||
'journal_mode' => null,
|
||||
'synchronous' => null,
|
||||
'transaction_mode' => 'DEFERRED',
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'mariadb' => [
|
||||
'driver' => 'mariadb',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => env('DB_SSLMODE', 'prefer'),
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run on the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => [
|
||||
'table' => 'migrations',
|
||||
'update_date_on_publish' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as Memcached. You may define your connection settings here.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'),
|
||||
'persistent' => env('REDIS_PERSISTENT', false),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
'max_retries' => env('REDIS_MAX_RETRIES', 3),
|
||||
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
|
||||
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
|
||||
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
'max_retries' => env('REDIS_MAX_RETRIES', 3),
|
||||
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
|
||||
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
|
||||
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application for file storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you may configure as many filesystem disks as necessary, and you
|
||||
| may even configure multiple disks for the same driver. Examples for
|
||||
| most supported storage drivers are configured here for reference.
|
||||
|
|
||||
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private'),
|
||||
'serve' => true,
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Symbolic Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the symbolic links that will be created when the
|
||||
| `storage:link` Artisan command is executed. The array keys should be
|
||||
| the locations of the links and the values should be their targets.
|
||||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that is utilized to write
|
||||
| messages to your logs. The value provided here should match one of
|
||||
| the channels present in the list of "channels" configured below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Deprecations Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the log channel that should be used to log warnings
|
||||
| regarding deprecated PHP and library features. This allows you to get
|
||||
| your application ready for upcoming major versions of dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'deprecations' => [
|
||||
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Laravel
|
||||
| utilizes the Monolog PHP logging library, which includes a variety
|
||||
| of powerful log handlers and formatters that you're free to use.
|
||||
|
|
||||
| Available drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog", "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => env('LOG_DAILY_DAYS', 14),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
||||
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'handler_with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default mailer that is used to send all email
|
||||
| messages unless another mailer is explicitly specified when sending
|
||||
| the message. All additional mailers can be configured within the
|
||||
| "mailers" array. Examples of each type of mailer are provided.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('MAIL_MAILER', 'log'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailer Configurations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure all of the mailers used by your application plus
|
||||
| their respective settings. Several examples have been configured for
|
||||
| you and you are free to add your own as your application requires.
|
||||
|
|
||||
| Laravel supports a variety of mail "transport" drivers that can be used
|
||||
| when delivering an email. You may specify which one you're using for
|
||||
| your mailers below. You may also add additional mailers if needed.
|
||||
|
|
||||
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||
| "postmark", "resend", "log", "array",
|
||||
| "failover", "roundrobin"
|
||||
|
|
||||
*/
|
||||
|
||||
'mailers' => [
|
||||
|
||||
'smtp' => [
|
||||
'transport' => 'smtp',
|
||||
'scheme' => env('MAIL_SCHEME'),
|
||||
'url' => env('MAIL_URL'),
|
||||
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||
'port' => env('MAIL_PORT', 2525),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
|
||||
// 'client' => [
|
||||
// 'timeout' => 5,
|
||||
// ],
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'transport' => 'resend',
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'transport' => 'log',
|
||||
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'transport' => 'array',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'transport' => 'failover',
|
||||
'mailers' => [
|
||||
'smtp',
|
||||
'log',
|
||||
],
|
||||
'retry_after' => 60,
|
||||
],
|
||||
|
||||
'roundrobin' => [
|
||||
'transport' => 'roundrobin',
|
||||
'mailers' => [
|
||||
'ses',
|
||||
'postmark',
|
||||
],
|
||||
'retry_after' => 60,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all emails sent by your application to be sent from
|
||||
| the same address. Here you may specify a name and address that is
|
||||
| used globally for all emails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => [
|
||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel's queue supports a variety of backends via a single, unified
|
||||
| API, giving you convenient access to each backend using identical
|
||||
| syntax for each. The default queue connection is defined below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('QUEUE_CONNECTION', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection options for every queue backend
|
||||
| used by your application. An example configuration is provided for
|
||||
| each backend supported by Laravel. You're also free to add more.
|
||||
|
|
||||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
|
||||
| "deferred", "background", "failover", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sync' => [
|
||||
'driver' => 'sync',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_QUEUE_CONNECTION'),
|
||||
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
||||
'queue' => env('DB_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'beanstalkd' => [
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
||||
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => 0,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'sqs' => [
|
||||
'driver' => 'sqs',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||
'queue' => env('SQS_QUEUE', 'default'),
|
||||
'suffix' => env('SQS_SUFFIX'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'deferred' => [
|
||||
'driver' => 'deferred',
|
||||
],
|
||||
|
||||
'background' => [
|
||||
'driver' => 'background',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'driver' => 'failover',
|
||||
'connections' => [
|
||||
'database',
|
||||
'deferred',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Job Batching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following options configure the database and table that store job
|
||||
| batching information. These options can be updated to any database
|
||||
| connection and table which has been defined by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'batching' => [
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'job_batches',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Failed Queue Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These options configure the behavior of failed queue job logging so you
|
||||
| can control how and where failed jobs are stored. Laravel ships with
|
||||
| support for storing failed jobs in a simple file or in a database.
|
||||
|
|
||||
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => [
|
||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Third Party Services
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is for storing the credentials for third party services such
|
||||
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||
| location for this type of information, allowing packages to have
|
||||
| a conventional file to locate the various service credentials.
|
||||
|
|
||||
*/
|
||||
|
||||
'postmark' => [
|
||||
'key' => env('POSTMARK_API_KEY'),
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'key' => env('RESEND_API_KEY'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'notifications' => [
|
||||
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines the default session driver that is utilized for
|
||||
| incoming requests. Laravel supports a variety of storage options to
|
||||
| persist session data. Database storage is a great default choice.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "memcached",
|
||||
| "redis", "dynamodb", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to expire immediately when the browser is closed then you may
|
||||
| indicate that via the expire_on_close configuration option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to easily specify that all of your session data
|
||||
| should be encrypted before it's stored. All encryption is performed
|
||||
| automatically by Laravel and you may use the session like normal.
|
||||
|
|
||||
*/
|
||||
|
||||
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the "file" session driver, the session files are placed
|
||||
| on disk. The default storage location is defined here; however, you
|
||||
| are free to provide another location where they should be stored.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path('framework/sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => env('SESSION_CONNECTION'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table to
|
||||
| be used to store sessions. Of course, a sensible default is defined
|
||||
| for you; however, you're welcome to change this to another table.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => env('SESSION_TABLE', 'sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using one of the framework's cache driven session backends, you may
|
||||
| define the cache store which should be used to store the session data
|
||||
| between requests. This must match one of your defined cache stores.
|
||||
|
|
||||
| Affects: "dynamodb", "memcached", "redis"
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => env('SESSION_STORE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => [2, 100],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the session cookie that is created by
|
||||
| the framework. Typically, you should not need to change this value
|
||||
| since doing so does not grant a meaningful security improvement.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug((string) env('APP_NAME', 'laravel')).'-session'
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application, but you're free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('SESSION_PATH', '/'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the domain and subdomains the session cookie is
|
||||
| available to. By default, the cookie will be available to the root
|
||||
| domain without subdomains. Typically, this shouldn't be changed.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('SESSION_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you when it can't be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Access Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will prevent JavaScript from accessing the
|
||||
| value of the cookie and the cookie will only be accessible through
|
||||
| the HTTP protocol. It's unlikely you should disable this option.
|
||||
|
|
||||
*/
|
||||
|
||||
'http_only' => env('SESSION_HTTP_ONLY', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Same-Site Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how your cookies behave when cross-site requests
|
||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||
| will set this value to "lax" to permit secure cross-site requests.
|
||||
|
|
||||
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
||||
|
|
||||
| Supported: "lax", "strict", "none", null
|
||||
|
|
||||
*/
|
||||
|
||||
'same_site' => env('SESSION_SAME_SITE', 'lax'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Partitioned Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will tie the cookie to the top-level site for
|
||||
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||
|
|
||||
*/
|
||||
|
||||
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1 @@
|
|||
*.sqlite*
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('role')->default('user');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gejalas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode')->unique();
|
||||
$table->string('nama');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('gejalas');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('penyakits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode')->unique(); // kode unik (P01, P02)
|
||||
$table->string('nama'); // nama penyakit
|
||||
$table->text('deskripsi')->nullable(); // penjelasan
|
||||
$table->text('solusi')->nullable(); // solusi penanganan
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('penyakits');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('edukasis', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('judul');
|
||||
$table->text('isi');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('edukasis');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('rules', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('kode');
|
||||
$table->foreignId('gejala_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('penyakit_id')->constrained()->cascadeOnDelete();
|
||||
|
||||
// rule CF
|
||||
$table->float('mb'); // Kepercayaan
|
||||
$table->float('md'); // Ketidakpercayaan
|
||||
|
||||
$table->float('cf')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rules');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('pasiens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama');
|
||||
$table->string('jenis_kelamin');
|
||||
$table->string('tempat_lahir');
|
||||
$table->date('tanggal_lahir');
|
||||
$table->text('alamat');
|
||||
$table->string('no_telp');
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('pasiens');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('diagnosas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('pasien_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('penyakit_id')->constrained()->onDelete('cascade');
|
||||
$table->float('cf_hasil');
|
||||
$table->text('gejala_dipilih'); // simpan JSON
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('diagnosas');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('penyakits', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('penyakits', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('penyakits', function (Blueprint $table) {
|
||||
$table->text('komplikasi')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('penyakits', function (Blueprint $table) {
|
||||
$table->dropColumn('komplikasi');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('edukasis', function (Blueprint $table) {
|
||||
$table->string('gambar')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('edukasis', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
use WithoutModelEvents;
|
||||
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://www.schemastore.org/package.json",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"axios": "^1.11.0",
|
||||
"bootstrap": "^5.2.3",
|
||||
"concurrently": "^9.0.1",
|
||||
"laravel-vite-plugin": "^2.0.0",
|
||||
"sass": "^1.56.1",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"vite": "^7.0.7"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory>tests/Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Feature">
|
||||
<directory>tests/Feature</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<source>
|
||||
<include>
|
||||
<directory>app</directory>
|
||||
</include>
|
||||
</source>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="BROADCAST_CONNECTION" value="null"/>
|
||||
<env name="CACHE_STORE" value="array"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="PULSE_ENABLED" value="false"/>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
<env name="NIGHTWATCH_ENABLED" value="false"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
<IfModule mod_negotiation.c>
|
||||
Options -MultiViews -Indexes
|
||||
</IfModule>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# Handle Authorization Header
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
|
||||
# Handle X-XSRF-Token Header
|
||||
RewriteCond %{HTTP:x-xsrf-token} .
|
||||
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
|
||||
|
||||
# Redirect Trailing Slashes If Not A Folder...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} (.+)/$
|
||||
RewriteRule ^ %1 [L,R=301]
|
||||
|
||||
# Send Requests To Front Controller...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [L]
|
||||
</IfModule>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Determine if the application is in maintenance mode...
|
||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||
require $maintenance;
|
||||
}
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the request...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->handleRequest(Request::capture());
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
User-agent: *
|
||||
Disallow:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 237 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
|
|
@ -0,0 +1,11 @@
|
|||
@import 'tailwindcss';
|
||||
|
||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||
@source '../../storage/framework/views/*.php';
|
||||
@source '../**/*.blade.php';
|
||||
@source '../**/*.js';
|
||||
|
||||
@theme {
|
||||
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
import './bootstrap';
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
import 'bootstrap';
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
// Body
|
||||
$body-bg: #f8fafc;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: 'Nunito', sans-serif;
|
||||
$font-size-base: 0.9rem;
|
||||
$line-height-base: 1.6;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// Fonts
|
||||
@import url('https://fonts.bunny.net/css?family=Nunito');
|
||||
|
||||
// Variables
|
||||
@import 'variables';
|
||||
|
||||
// Bootstrap
|
||||
@import 'bootstrap/scss/bootstrap';
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- PASIEN -->
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="card shadow-sm text-white bg-primary">
|
||||
<div class="card-body">
|
||||
<h5>Total Pasien</h5>
|
||||
<h2>{{ $totalPasien }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIAGNOSA -->
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="card shadow-sm text-white bg-success">
|
||||
<div class="card-body">
|
||||
<h5>Total Diagnosa</h5>
|
||||
<h2>{{ $totalDiagnosa }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PENYAKIT -->
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="card shadow-sm text-white bg-warning">
|
||||
<div class="card-body">
|
||||
<h5>Total Penyakit</h5>
|
||||
<h2>{{ $totalPenyakit }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GEJALA -->
|
||||
<div class="col-md-3 mb-3">
|
||||
<div class="card shadow-sm text-white bg-danger">
|
||||
<div class="card-body">
|
||||
<h5>Total Gejala</h5>
|
||||
<h2>{{ $totalGejala }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- GRAFIK -->
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-body">
|
||||
<h5 class="mb-3">Grafik Hasil Diagnosa</h5>
|
||||
<canvas id="chartDiagnosa"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<!-- CHART JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
<script>
|
||||
const dataChart = {
|
||||
labels: [
|
||||
@foreach($chart as $c)
|
||||
"{{ $c->penyakit->nama }}",
|
||||
@endforeach
|
||||
],
|
||||
datasets: [{
|
||||
label: 'Jumlah Diagnosa',
|
||||
data: [
|
||||
@foreach($chart as $c)
|
||||
{{ $c->total }},
|
||||
@endforeach
|
||||
]
|
||||
}]
|
||||
};
|
||||
|
||||
const config = {
|
||||
type: 'bar',
|
||||
data: dataChart,
|
||||
options: {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new Chart(document.getElementById('chartDiagnosa'), config);
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Edukasi')
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- BUTTON -->
|
||||
<button class="btn btn-primary mb-3" onclick="showForm()">+ Tambah Edukasi</button>
|
||||
|
||||
<!-- TABLE -->
|
||||
<div id="tableEdukasi">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Bahaya Hipertensi</td>
|
||||
<td>Hipertensi dapat menyebabkan stroke dan gagal ginjal...</td>
|
||||
<td>
|
||||
<button class="btn btn-warning btn-sm" onclick="editData()">Edit</button>
|
||||
<button class="btn btn-danger btn-sm">Hapus</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- FORM -->
|
||||
<div id="formEdukasi" style="display:none;">
|
||||
|
||||
<h5 id="formTitle">Tambah Edukasi</h5>
|
||||
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label>Judul Edukasi</label>
|
||||
<input type="text" class="form-control" id="judul">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Deskripsi Edukasi</label>
|
||||
<textarea class="form-control" id="deskripsi" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Simpan</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="showTable()">Kembali</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- SCRIPT -->
|
||||
<script>
|
||||
function showForm() {
|
||||
document.getElementById('tableEdukasi').style.display = 'none';
|
||||
document.getElementById('formEdukasi').style.display = 'block';
|
||||
document.getElementById('formTitle').innerText = 'Tambah Edukasi';
|
||||
|
||||
// reset form
|
||||
document.getElementById('judul').value = '';
|
||||
document.getElementById('deskripsi').value = '';
|
||||
}
|
||||
|
||||
function showTable() {
|
||||
document.getElementById('tableEdukasi').style.display = 'block';
|
||||
document.getElementById('formEdukasi').style.display = 'none';
|
||||
}
|
||||
|
||||
function editData() {
|
||||
showForm();
|
||||
document.getElementById('formTitle').innerText = 'Edit Edukasi';
|
||||
|
||||
// dummy data
|
||||
document.getElementById('judul').value = 'Bahaya Hipertensi';
|
||||
document.getElementById('deskripsi').value = 'Hipertensi dapat menyebabkan stroke dan gagal ginjal...';
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Tambah Edukasi')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- <form action="{{ route('edukasi.store') }}" method="POST"> -->
|
||||
<form action="{{ route('edukasi.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
<!-- GAMBAR -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Gambar</label>
|
||||
<input type="file" name="gambar" class="form-control">
|
||||
</div>
|
||||
|
||||
<!-- JUDUL -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Judul</label>
|
||||
<input type="text" name="judul" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<!-- ISI -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Isi Edukasi</label>
|
||||
<textarea id="isi" name="isi"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<button class="btn btn-success">Simpan</button>
|
||||
<a href="{{ route('edukasi.index') }}" class="btn btn-secondary">Kembali</a>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<!-- CKEditor 5 -->
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/39.0.1/classic/ckeditor.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
ClassicEditor.create(document.querySelector('#isi'), {
|
||||
toolbar: [
|
||||
'heading', '|',
|
||||
'bold', 'italic', 'underline', 'strikethrough', '|',
|
||||
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', '|',
|
||||
'alignment', '|',
|
||||
'bulletedList', 'numberedList', 'outdent', 'indent', '|',
|
||||
'link', 'blockQuote', 'insertTable', '|',
|
||||
'undo', 'redo'
|
||||
]
|
||||
}).catch(error => console.error(error));
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Edit Edukasi')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('edukasi.update', $edukasi->id) }}"
|
||||
method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- GAMBAR -->
|
||||
@if($edukasi->gambar)
|
||||
<div class="mb-3">
|
||||
<label>Gambar Saat Ini</label><br>
|
||||
<img src="{{ asset('uploads/'.$edukasi->gambar) }}"
|
||||
style="max-height:150px;"
|
||||
class="rounded mb-2">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Ganti Gambar</label>
|
||||
<input type="file" name="gambar" class="form-control">
|
||||
</div>
|
||||
|
||||
<!-- JUDUL -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Judul</label>
|
||||
<input type="text"
|
||||
name="judul"
|
||||
value="{{ $edukasi->judul }}"
|
||||
class="form-control"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- ISI -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Isi Edukasi</label>
|
||||
<textarea id="isi" name="isi">{!! $edukasi->isi !!}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<button class="btn btn-success">Update</button>
|
||||
<a href="{{ route('edukasi.index') }}" class="btn btn-secondary">Kembali</a>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<!-- ✅ CKEDITOR 5 (SAMA SEPERTI CREATE) -->
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/39.0.1/classic/ckeditor.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
ClassicEditor
|
||||
.create(document.querySelector('#isi'), {
|
||||
toolbar: [
|
||||
'heading', '|',
|
||||
'bold', 'italic', 'underline', 'strikethrough', '|',
|
||||
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', '|',
|
||||
'alignment', '|',
|
||||
'bulletedList', 'numberedList', 'outdent', 'indent', '|',
|
||||
'link', 'blockQuote', 'insertTable', '|',
|
||||
'undo', 'redo'
|
||||
]
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Edukasi')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm border-0 rounded-4">
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
|
||||
|
||||
<div>
|
||||
<h5 class="mb-0 fw-bold">Tabel Data Edukasi</h5>
|
||||
<small class="text-muted">
|
||||
Kelola informasi edukasi kesehatan
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET"
|
||||
action="{{ route('edukasi.index') }}"
|
||||
class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari edukasi..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- PER PAGE -->
|
||||
<form method="GET">
|
||||
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<a href="{{ route('edukasi.create') }}"
|
||||
class="btn btn-primary btn-sm">
|
||||
+ Tambah Edukasi
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover align-middle">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th>Judul</th>
|
||||
<th width="25%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($edukasis as $e)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration + ($edukasis->currentPage() - 1) * $edukasis->perPage() }}
|
||||
</td>
|
||||
|
||||
<td class="fw-semibold">
|
||||
{{ $e->judul }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
|
||||
<a href="{{ route('edukasi.show', $e->id) }}"
|
||||
class="btn btn-info btn-sm text-white">
|
||||
Detail
|
||||
</a>
|
||||
|
||||
<a href="{{ route('edukasi.edit', $e->id) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
Edit
|
||||
</a>
|
||||
|
||||
<form action="{{ route('edukasi.destroy', $e->id) }}"
|
||||
method="POST"
|
||||
style="display:inline;">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button class="btn btn-danger btn-sm">
|
||||
Hapus
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<!-- PESAN JIKA KOSONG -->
|
||||
<tr>
|
||||
|
||||
<td colspan="3" class="text-center py-4">
|
||||
|
||||
<div class="alert alert-info mb-0">
|
||||
|
||||
@if(request('search'))
|
||||
Edukasi tidak ditemukan.
|
||||
@else
|
||||
Belum ada data edukasi.
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="mt-3">
|
||||
{{ $edukasis->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Detail Edukasi')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<h4>{{ $edukasi->judul }}</h4>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- GAMBAR -->
|
||||
@if($edukasi->gambar)
|
||||
<img src="{{ asset('uploads/'.$edukasi->gambar) }}"
|
||||
class="img-fluid mb-3" style="max-height:300px;">
|
||||
@endif
|
||||
|
||||
<!-- ISI -->
|
||||
<div style="max-width:100%; overflow:hidden;">
|
||||
{!! $edukasi->isi !!}
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<a href="{{ route('edukasi.index') }}" class="btn btn-secondary">
|
||||
Kembali
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Gejala')
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- BUTTON -->
|
||||
<button class="btn btn-primary mb-3" onclick="showForm()">+ Tambah Gejala</button>
|
||||
|
||||
<!-- TABLE -->
|
||||
<div id="tableGejala">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Kode</th>
|
||||
<th>Nama Gejala</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>G01</td>
|
||||
<td>Sakit kepala</td>
|
||||
<td>
|
||||
<button class="btn btn-warning btn-sm" onclick="editData()">Edit</button>
|
||||
<button class="btn btn-danger btn-sm">Hapus</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- FORM -->
|
||||
<div id="formGejala" style="display:none;">
|
||||
|
||||
<h5 id="formTitle">Tambah Gejala</h5>
|
||||
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label>Kode Gejala</label>
|
||||
<input type="text" class="form-control" id="kode">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Nama Gejala</label>
|
||||
<input type="text" class="form-control" id="nama">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Simpan</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="showTable()">Kembali</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function showForm() {
|
||||
document.getElementById('tableGejala').style.display = 'none';
|
||||
document.getElementById('formGejala').style.display = 'block';
|
||||
document.getElementById('formTitle').innerText = 'Tambah Gejala';
|
||||
}
|
||||
|
||||
function showTable() {
|
||||
document.getElementById('tableGejala').style.display = 'block';
|
||||
document.getElementById('formGejala').style.display = 'none';
|
||||
}
|
||||
|
||||
function editData() {
|
||||
showForm();
|
||||
document.getElementById('formTitle').innerText = 'Edit Gejala';
|
||||
|
||||
// isi dummy
|
||||
document.getElementById('kode').value = 'G01';
|
||||
document.getElementById('nama').value = 'Sakit kepala';
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Tambah Gejala')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('gejala.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<!-- KODE -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kode Gejala</label>
|
||||
<input type="text"
|
||||
name="kode"
|
||||
class="form-control"
|
||||
value="{{ $kode }}"
|
||||
readonly>
|
||||
</div>
|
||||
|
||||
<!-- NAMA -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nama Gejala</label>
|
||||
<input type="text"
|
||||
name="nama"
|
||||
class="form-control"
|
||||
placeholder="Masukkan gejala"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-success">
|
||||
Simpan
|
||||
</button>
|
||||
|
||||
<a href="{{ route('gejala.index') }}" class="btn btn-secondary">
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Edit Gejala')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('gejala.update', $gejala->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- KODE -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kode Gejala</label>
|
||||
<input type="text"
|
||||
name="kode"
|
||||
value="{{ $gejala->kode }}"
|
||||
class="form-control"
|
||||
readonly>
|
||||
</div>
|
||||
|
||||
<!-- NAMA -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nama Gejala</label>
|
||||
<input type="text"
|
||||
name="nama"
|
||||
value="{{ $gejala->nama }}"
|
||||
class="form-control"
|
||||
placeholder="Masukkan gejala"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-success">
|
||||
Update
|
||||
</button>
|
||||
|
||||
<a href="{{ route('gejala.index') }}" class="btn btn-secondary">
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Gejala')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
|
||||
<!-- BUTTON TAMBAH -->
|
||||
<a href="{{ route('gejala.create') }}" class="btn btn-primary">
|
||||
+ Tambah Gejala
|
||||
</a>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET" class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari gejala..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- PER PAGE -->
|
||||
<form method="GET">
|
||||
|
||||
<!-- AGAR SEARCH TETAP ADA -->
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ALERT -->
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover align-middle">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="70">No</th>
|
||||
<th width="120">Kode</th>
|
||||
<th>Nama</th>
|
||||
<th width="180">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($gejalas as $g)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration + ($gejalas->currentPage() - 1) * $gejalas->perPage() }}
|
||||
</td>
|
||||
|
||||
<td>{{ $g->kode }}</td>
|
||||
|
||||
<td>{{ $g->nama }}</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="{{ route('gejala.edit', $g->id) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
Edit
|
||||
</a>
|
||||
|
||||
<form action="{{ route('gejala.destroy', $g->id) }}"
|
||||
method="POST"
|
||||
style="display:inline;">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('Yakin ingin menghapus data ini?')">
|
||||
Hapus
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="text-center text-muted">
|
||||
|
||||
@if(request('search'))
|
||||
Data gejala tidak ditemukan
|
||||
@else
|
||||
Belum ada data gejala
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="mt-3">
|
||||
{{ $gejalas->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Hasil Diagnosa')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow">
|
||||
<div class="card-body">
|
||||
|
||||
<h4 class="mb-3">Hasil Diagnosa</h4>
|
||||
|
||||
<p><b>Nama:</b> {{ $diagnosa->pasien->nama }}</p>
|
||||
<p><b>Penyakit:</b> {{ $diagnosa->penyakit->nama }}</p>
|
||||
<p><b>Nilai CF:</b> {{ number_format($diagnosa->cf_hasil * 100, 2) }}%</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5>Deskripsi</h5>
|
||||
<p>{!! $diagnosa->penyakit->deskripsi !!}</p>
|
||||
|
||||
<h5>Solusi</h5>
|
||||
<p>{!! $diagnosa->penyakit->solusi !!}</p>
|
||||
|
||||
<h5>Risiko Komplikasi</h5>
|
||||
<p>{!! $diagnosa->penyakit->komplikasi ?? '-' !!}</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="{{ route('diagnosa.pdf', $diagnosa->id) }}"
|
||||
class="btn btn-success">
|
||||
Download PDF
|
||||
</a>
|
||||
|
||||
<a href="{{ route('admin.riwayat') }}"
|
||||
class="btn btn-secondary">
|
||||
Kembali
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Pasien')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
|
||||
<div>
|
||||
<h4 class="fw-bold mb-1">Tabel Data Pasien</h4>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET" class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari pasien..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- PER PAGE -->
|
||||
<form method="GET">
|
||||
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover align-middle">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama</th>
|
||||
<th>Jenis Kelamin</th>
|
||||
<th>Tanggal Lahir</th>
|
||||
<th>Alamat</th>
|
||||
<th>No Telp</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($pasiens as $p)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>{{ $loop->iteration + ($pasiens->currentPage() - 1) * $pasiens->perPage() }}</td>
|
||||
<td>{{ $p->nama }}</td>
|
||||
<td>{{ $p->jenis_kelamin }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($p->tanggal_lahir)->format('d-m-Y') }}</td>
|
||||
<td>{{ $p->alamat }}</td>
|
||||
<td>{{ $p->no_telp }}</td>
|
||||
<td>{{ $p->user->email ?? '-' }}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="5" class="text-center text-muted">
|
||||
|
||||
@if(request('search'))
|
||||
Data pasien tidak ditemukan
|
||||
@else
|
||||
Belum ada data pasien
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="mt-3">
|
||||
{{ $pasiens->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Tambah Penyakit')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('penyakit.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<!-- Kode Penyakit -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kode Penyakit</label>
|
||||
<input type="text"
|
||||
name="kode"
|
||||
class="form-control"
|
||||
value="{{ $kode }}"
|
||||
readonly>
|
||||
</div>
|
||||
|
||||
<!-- Nama Penyakit -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nama Penyakit</label>
|
||||
<input type="text" name="nama" class="form-control" placeholder="Masukan Penyakit" required>
|
||||
</div>
|
||||
|
||||
<!-- Deskripsi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Deskripsi</label>
|
||||
<textarea id="deskripsi" name="deskripsi"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Solusi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Solusi</label>
|
||||
<textarea id="solusi" name="solusi"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Komplikasi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Komplikasi</label>
|
||||
<textarea id="komplikasi" name="komplikasi"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Button -->
|
||||
<button class="btn btn-success">Simpan</button>
|
||||
<a href="{{ route('penyakit.index') }}" class="btn btn-secondary">Kembali</a>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<!-- CKEditor 5 -->
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/39.0.1/classic/ckeditor.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
const config = {
|
||||
toolbar: [
|
||||
'heading', '|',
|
||||
'bold', 'italic', 'underline', 'strikethrough', '|',
|
||||
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', '|',
|
||||
'alignment', '|',
|
||||
'bulletedList', 'numberedList', 'outdent', 'indent', '|',
|
||||
'link', 'blockQuote', 'insertTable', 'mediaEmbed', '|',
|
||||
'undo', 'redo'
|
||||
]
|
||||
};
|
||||
|
||||
ClassicEditor.create(document.querySelector('#deskripsi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
ClassicEditor.create(document.querySelector('#solusi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
ClassicEditor.create(document.querySelector('#komplikasi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Edit Penyakit')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('penyakit.update', $penyakit->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- Kode Penyakit -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kode Penyakit</label>
|
||||
<input type="text"
|
||||
name="kode"
|
||||
value="{{ $penyakit->kode }}"
|
||||
class="form-control"
|
||||
readonly>
|
||||
</div>
|
||||
|
||||
<!-- Nama Penyakit -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nama Penyakit</label>
|
||||
<input type="text"
|
||||
name="nama"
|
||||
value="{{ $penyakit->nama }}"
|
||||
class="form-control"
|
||||
placeholder="Masukan Penyakit"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- Deskripsi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Deskripsi</label>
|
||||
<textarea id="deskripsi" name="deskripsi">{!! $penyakit->deskripsi !!}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- Solusi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Solusi</label>
|
||||
<textarea id="solusi" name="solusi">{!! $penyakit->solusi !!}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- Komplikasi -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Risiko Komplikasi</label>
|
||||
<textarea id="komplikasi" name="komplikasi">{!! $penyakit->komplikasi !!}</textarea>
|
||||
<small class="text-muted">
|
||||
Contoh: Stroke, gagal ginjal, penyakit jantung
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON -->
|
||||
<button class="btn btn-success">Update</button>
|
||||
<a href="{{ route('penyakit.index') }}" class="btn btn-secondary">Kembali</a>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<!-- CKEditor 5 -->
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/39.0.1/classic/ckeditor.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
const config = {
|
||||
toolbar: [
|
||||
'heading', '|',
|
||||
'bold', 'italic', 'underline', 'strikethrough', '|',
|
||||
'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', '|',
|
||||
'alignment', '|',
|
||||
'bulletedList', 'numberedList', 'outdent', 'indent', '|',
|
||||
'link', 'blockQuote', 'insertTable', '|',
|
||||
'undo', 'redo'
|
||||
]
|
||||
};
|
||||
|
||||
ClassicEditor.create(document.querySelector('#deskripsi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
ClassicEditor.create(document.querySelector('#solusi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
ClassicEditor.create(document.querySelector('#komplikasi'), config)
|
||||
.catch(error => console.error(error));
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Penyakit')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
|
||||
<!-- BUTTON -->
|
||||
<a href="{{ route('penyakit.create') }}"
|
||||
class="btn btn-primary">
|
||||
+ Tambah Penyakit
|
||||
</a>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET" class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari penyakit..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- PER PAGE -->
|
||||
<form method="GET">
|
||||
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ALERT -->
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover align-middle">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="70">No</th>
|
||||
<th width="120">Kode</th>
|
||||
<th>Nama Penyakit</th>
|
||||
<th width="180">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($penyakits as $p)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration + ($penyakits->currentPage() - 1) * $penyakits->perPage() }}
|
||||
</td>
|
||||
|
||||
<td>{{ $p->kode }}</td>
|
||||
|
||||
<td>{{ $p->nama }}</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="{{ route('penyakit.edit', $p->id) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
Edit
|
||||
</a>
|
||||
|
||||
<form action="{{ route('penyakit.destroy', $p->id) }}"
|
||||
method="POST"
|
||||
style="display:inline;">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('Yakin ingin menghapus data ini?')">
|
||||
Hapus
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="text-center text-muted">
|
||||
|
||||
@if(request('search'))
|
||||
Data penyakit tidak ditemukan
|
||||
@else
|
||||
Belum ada data penyakit
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="mt-3">
|
||||
{{ $penyakits->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Riwayat')
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- CARD -->
|
||||
<div class="card shadow-sm border-0 rounded-4">
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
|
||||
|
||||
<div>
|
||||
<h4 class="fw-bold mb-1">Tabel Riwayat Diagnosa</h4>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET" class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari pasien / penyakit..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- SELECT DATA -->
|
||||
<form method="GET">
|
||||
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered align-middle table-hover">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th>Nama</th>
|
||||
<th>Penyakit</th>
|
||||
<th>CF (%)</th>
|
||||
<th>Tanggal</th>
|
||||
<th width="20%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($data as $d)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration + ($data->currentPage() - 1) * $data->perPage() }}
|
||||
</td>
|
||||
|
||||
<td class="fw-semibold">
|
||||
{{ $d->pasien->nama ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $d->penyakit->nama }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="badge bg-success px-3 py-2">
|
||||
{{ number_format($d->cf_hasil * 100, 2) }}%
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $d->created_at->format('d-m-Y') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
|
||||
<a href="{{ route('diagnosa.hasil', $d->id) }}"
|
||||
class="btn btn-info btn-sm text-white">
|
||||
Preview
|
||||
</a>
|
||||
|
||||
<a href="{{ route('diagnosa.pdf', $d->id) }}"
|
||||
class="btn btn-success btn-sm">
|
||||
Download PDF
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-4">
|
||||
|
||||
<div class="alert alert-info mb-0">
|
||||
|
||||
@if(request('search'))
|
||||
Data tidak ditemukan
|
||||
@else
|
||||
Belum ada data riwayat
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div>
|
||||
{{ $data->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Rule')
|
||||
|
||||
@section('content')
|
||||
<p>Halaman Data Rule</p>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Tambah Rule CF')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<b>Form Tambah Rule CF</b>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
{{-- ALERT ERROR --}}
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul class="mb-0">
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- ALERT LOGIKA CF --}}
|
||||
@if(session('error'))
|
||||
<div class="alert alert-warning">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('rule.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
{{-- GEJALA --}}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Gejala</label>
|
||||
<select name="gejala_id" class="form-control">
|
||||
<option value="">-- Pilih Gejala --</option>
|
||||
@foreach($gejalas as $g)
|
||||
<option value="{{ $g->id }}">
|
||||
{{ $g->kode }} - {{ $g->nama }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- PENYAKIT --}}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Penyakit</label>
|
||||
<select name="penyakit_id" class="form-control">
|
||||
<option value="">-- Pilih Penyakit --</option>
|
||||
@foreach($penyakits as $p)
|
||||
<option value="{{ $p->id }}">
|
||||
{{ $p->kode }} - {{ $p->nama }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{-- MB --}}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">MB (Measure of Belief)</label>
|
||||
<input type="number" step="0.01" name="mb"
|
||||
class="form-control"
|
||||
placeholder="Contoh: 0.8 (nilai 0 - 1)"
|
||||
value="{{ old('mb') }}">
|
||||
</div>
|
||||
|
||||
{{-- MD --}}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">MD (Measure of Disbelief)</label>
|
||||
<input type="number" step="0.01" name="md"
|
||||
class="form-control"
|
||||
placeholder="Contoh: 0.2 (nilai 0 - 1)"
|
||||
value="{{ old('md') }}">
|
||||
</div>
|
||||
|
||||
{{-- BUTTON --}}
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="{{ route('rule.index') }}" class="btn btn-secondary">
|
||||
← Kembali
|
||||
</a>
|
||||
|
||||
<button class="btn btn-success">
|
||||
Simpan Rule
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Edit Rule')
|
||||
|
||||
@section('content')
|
||||
|
||||
<form action="{{ route('rule.update', $rule->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Gejala</label>
|
||||
<select name="gejala_id" class="form-control">
|
||||
@foreach($gejalas as $g)
|
||||
<option value="{{ $g->id }}"
|
||||
{{ $rule->gejala_id == $g->id ? 'selected' : '' }}>
|
||||
{{ $g->nama }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Penyakit</label>
|
||||
<select name="penyakit_id" class="form-control">
|
||||
@foreach($penyakits as $p)
|
||||
<option value="{{ $p->id }}"
|
||||
{{ $rule->penyakit_id == $p->id ? 'selected' : '' }}>
|
||||
{{ $p->nama }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>MB</label>
|
||||
<input type="number" step="0.01" name="mb" value="{{ $rule->mb }}" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>MD</label>
|
||||
<input type="number" step="0.01" name="md" value="{{ $rule->md }}" class="form-control">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Update</button>
|
||||
<a href="{{ route('rule.index') }}" class="btn btn-secondary">Kembali</a>
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Data Rule CF')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
|
||||
<!-- BUTTON -->
|
||||
<a href="{{ route('rule.create') }}" class="btn btn-primary">
|
||||
+ Tambah Rule
|
||||
</a>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form method="GET" class="d-flex">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control form-control-sm"
|
||||
placeholder="Cari gejala / penyakit..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<button class="btn btn-primary btn-sm ms-2">
|
||||
Cari
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- PER PAGE -->
|
||||
<form method="GET">
|
||||
|
||||
<!-- AGAR SEARCH TETAP ADA -->
|
||||
<input type="hidden"
|
||||
name="search"
|
||||
value="{{ request('search') }}">
|
||||
|
||||
<select name="perPage"
|
||||
onchange="this.form.submit()"
|
||||
class="form-select form-select-sm">
|
||||
|
||||
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
||||
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
||||
|
||||
</select>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ALERT -->
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover align-middle">
|
||||
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="70">No</th>
|
||||
<th>Gejala</th>
|
||||
<th>Penyakit</th>
|
||||
<th width="90">MB</th>
|
||||
<th width="90">MD</th>
|
||||
<th width="90">CF</th>
|
||||
<th width="180">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($rules as $r)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration + ($rules->currentPage() - 1) * $rules->perPage() }}
|
||||
</td>
|
||||
|
||||
<td>{{ $r->gejala->nama }}</td>
|
||||
|
||||
<td>{{ $r->penyakit->nama }}</td>
|
||||
|
||||
<td>{{ $r->mb }}</td>
|
||||
|
||||
<td>{{ $r->md }}</td>
|
||||
|
||||
<td>
|
||||
<b>{{ $r->cf }}</b>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="{{ route('rule.edit', $r->id) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
Edit
|
||||
</a>
|
||||
|
||||
<form action="{{ route('rule.destroy', $r->id) }}"
|
||||
method="POST"
|
||||
style="display:inline;">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('Yakin ingin menghapus data ini?')">
|
||||
Hapus
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="7" class="text-center text-muted">
|
||||
|
||||
@if(request('search'))
|
||||
Data rule tidak ditemukan
|
||||
@else
|
||||
Belum ada data rule
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="mt-3">
|
||||
{{ $rules->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
@php $noNavbar = true; @endphp
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
margin:0;
|
||||
height:100vh;
|
||||
background:#eaf2ff;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
font-family: 'Segoe UI', sans-serif;
|
||||
}
|
||||
|
||||
.login-wrapper{
|
||||
width:1000px;
|
||||
max-width:95%;
|
||||
background:#fff;
|
||||
border-radius:20px;
|
||||
box-shadow:0 20px 40px rgba(0,0,0,0.08);
|
||||
display:flex;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
/* LEFT */
|
||||
.login-left{
|
||||
width:55%;
|
||||
background:#f3f7ff;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
padding:40px;
|
||||
}
|
||||
|
||||
.login-left img{
|
||||
width:100%;
|
||||
max-width:400px;
|
||||
}
|
||||
|
||||
/* RIGHT */
|
||||
.login-right{
|
||||
width:45%;
|
||||
padding:60px 50px;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
.login-right h2{
|
||||
font-weight:700;
|
||||
margin-bottom:30px;
|
||||
color:#2563eb;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.form-control{
|
||||
border-radius:10px;
|
||||
padding:10px 12px;
|
||||
}
|
||||
|
||||
.form-control:focus{
|
||||
border-color:#2563eb;
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
.btn-login{
|
||||
background:#2563eb;
|
||||
border:none;
|
||||
border-radius:10px;
|
||||
padding:10px;
|
||||
font-weight:600;
|
||||
}
|
||||
|
||||
.btn-login:hover{
|
||||
background:#1d4ed8;
|
||||
}
|
||||
|
||||
.auth-links{
|
||||
text-align:center;
|
||||
margin-top:20px;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.auth-links a{
|
||||
text-decoration:none;
|
||||
color:#2563eb;
|
||||
}
|
||||
|
||||
.auth-links a:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
@media(max-width:768px){
|
||||
.login-wrapper{
|
||||
flex-direction:column;
|
||||
}
|
||||
.login-left,
|
||||
.login-right{
|
||||
width:100%;
|
||||
}
|
||||
.login-right{
|
||||
padding:40px 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="login-wrapper">
|
||||
|
||||
<!-- LEFT IMAGE -->
|
||||
<div class="login-left">
|
||||
<!-- GANTI LINK GAMBAR SESUAI KEINGINAN -->
|
||||
<img src="{{ asset('uploads/logo.png') }}" alt="Login Illustration">
|
||||
</div>
|
||||
|
||||
<!-- RIGHT FORM -->
|
||||
<div class="login-right">
|
||||
|
||||
<h2>LOGIN</h2>
|
||||
|
||||
<form method="POST" action="{{ route('login') }}">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<input type="email"
|
||||
name="email"
|
||||
class="form-control @error('email') is-invalid @enderror"
|
||||
placeholder="Email"
|
||||
required
|
||||
autofocus>
|
||||
|
||||
@error('email')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<input type="password"
|
||||
name="password"
|
||||
class="form-control @error('password') is-invalid @enderror"
|
||||
placeholder="Password"
|
||||
required>
|
||||
|
||||
@error('password')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" name="remember" class="form-check-input">
|
||||
<label class="form-check-label">Remember Me</label>
|
||||
</div>
|
||||
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-login text-white">
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="auth-links">
|
||||
@if (Route::has('password.request'))
|
||||
<a href="{{ route('password.request') }}">
|
||||
Forgot Password?
|
||||
</a>
|
||||
@endif
|
||||
<br>
|
||||
<a href="{{ route('register') }}">
|
||||
Don't have an account? Sign Up
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue