feat: first commit
18
.editorconfig
Normal file
@ -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
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
65
.env.example
Normal file
@ -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}"
|
||||
11
.gitattributes
vendored
Normal file
@ -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
|
||||
23
.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/.phpunit.cache
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/storage/pail
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/auth.json
|
||||
/.fleet
|
||||
/.idea
|
||||
/.nova
|
||||
/.vscode
|
||||
/.zed
|
||||
61
README.md
Normal file
@ -0,0 +1,61 @@
|
||||
<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 may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
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).
|
||||
58
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
// Tampilkan form lupa password
|
||||
public function password()
|
||||
{
|
||||
return view('auth.forgot-password');
|
||||
}
|
||||
|
||||
// Validasi permintaan reset password
|
||||
public function validateForgotPasswordRequest(Request $request)
|
||||
{
|
||||
return $request->validate([
|
||||
'email' => 'required|email|exists:users,email',
|
||||
]);
|
||||
}
|
||||
|
||||
// Proses lupa password
|
||||
public function forgotPassword(Request $request)
|
||||
{
|
||||
// Validasi input
|
||||
$validatedData = $this->validateForgotPasswordRequest($request);
|
||||
|
||||
// Generate token
|
||||
$token = Str::random(64);
|
||||
|
||||
// Simpan token ke dalam tabel password_resets
|
||||
DB::table('password_resets')->insert([
|
||||
'email' => $request->email,
|
||||
'token' => $token,
|
||||
'created_at' => Carbon::now()
|
||||
]);
|
||||
|
||||
// Kirim email reset password
|
||||
Mail::send('auth.email.form-forget-Password', ['token' => $token], function ($message) use ($request) {
|
||||
$message->to($request->email);
|
||||
$message->subject('Reset Password');
|
||||
});
|
||||
|
||||
// Redirect dengan pesan yang sesuai
|
||||
return redirect()->route('password.reset', ['token' => $token])->with('status', 'Link reset password telah dikirim ke email Anda. Silakan cek untuk melanjutkan.');
|
||||
}
|
||||
}
|
||||
14
app/Http/Controllers/Auth/LoginController.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
||||
34
app/Http/Controllers/Auth/RegisterController.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
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:6|confirmed',
|
||||
]);
|
||||
}
|
||||
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
56
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function resetPassword($token)
|
||||
{
|
||||
return view('auth.email.form-forgot-password-link', ['token' => $token]);
|
||||
}
|
||||
|
||||
public function resetPasswordForm(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => 'required|email|exists:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
'password_confirmation' => 'required'
|
||||
]);
|
||||
|
||||
// Periksa apakah email ada dalam tabel users
|
||||
$userExists = User::where('email', $request->email)->exists();
|
||||
|
||||
if (!$userExists) {
|
||||
return response()->json(['error' => 'Email tidak ditemukan!'], 404);
|
||||
}
|
||||
|
||||
$updatePassword = DB::table('password_resets')
|
||||
->where([
|
||||
'email' => $request->email,
|
||||
'token' => $request->token
|
||||
])
|
||||
->first();
|
||||
|
||||
if (!$updatePassword) {
|
||||
return back()->withInput()->with('error', 'Salah token!');
|
||||
}
|
||||
|
||||
$user = User::where('email', $request->email)
|
||||
->update(['password' => Hash::make($request->password)]);
|
||||
|
||||
DB::table('password_resets')->where(['email' => $request->email])->delete();
|
||||
|
||||
return response()->json(['success' => 'Password berhasil diubah']);
|
||||
}
|
||||
}
|
||||
189
app/Http/Controllers/BillingController.php
Normal file
@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Billing;
|
||||
use App\Models\TrRegistrasi;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class BillingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$billings = Billing::with('registrasi')->orderBy('TanggalBilling', 'desc')->paginate(10);
|
||||
return view('admin.billing.index', compact('billings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$registrasis = TrRegistrasi::whereDoesntHave('billing')->get();
|
||||
return view('admin.billing.Input-form', compact('registrasis'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'IdRegistrasi' => 'required|exists:tr_registrasi,IdRegistrasi',
|
||||
'TanggalBilling' => 'required|date',
|
||||
'Dibayar' => 'required|numeric|min:0',
|
||||
'Keterangan' => 'nullable|string|max:255'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$billing = new Billing();
|
||||
$billing->IdRegistrasi = $request->IdRegistrasi;
|
||||
$billing->TanggalBilling = $request->TanggalBilling;
|
||||
$billing->Dibayar = $request->Dibayar;
|
||||
$billing->Keterangan = $request->Keterangan;
|
||||
|
||||
// Menghitung total biaya secara otomatis berdasarkan transaksi
|
||||
$billing->TotalBiaya = 0; // Nilai awal
|
||||
$billing->save();
|
||||
|
||||
// Menggunakan method dari model untuk menghitung total biaya
|
||||
$billing->TotalBiaya = $billing->calculateTotalBiaya();
|
||||
|
||||
// Update sisa dan status pembayaran
|
||||
$billing->updateSisa();
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('billing.show', $billing->IdBilling)
|
||||
->with('success', 'Billing berhasil dibuat.');
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()->back()
|
||||
->with('error', 'Terjadi kesalahan: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$billing = Billing::with('registrasi')->findOrFail($id);
|
||||
$transaksis = $billing->getTransaksiDetails();
|
||||
|
||||
return view('admin.billing.show-form', compact('billing', 'transaksis'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$billing = Billing::findOrFail($id);
|
||||
return view('billing.edit', compact('billing'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'TanggalBilling' => 'required|date',
|
||||
'Dibayar' => 'required|numeric|min:0',
|
||||
'Keterangan' => 'nullable|string|max:255'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$billing = Billing::findOrFail($id);
|
||||
$billing->TanggalBilling = $request->TanggalBilling;
|
||||
$billing->Dibayar = $request->Dibayar;
|
||||
$billing->Keterangan = $request->Keterangan;
|
||||
|
||||
// Recalculate total biaya (jika ada perubahan transaksi)
|
||||
$billing->TotalBiaya = $billing->calculateTotalBiaya();
|
||||
|
||||
// Update sisa dan status pembayaran
|
||||
$billing->updateSisa();
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('billing.show', $billing->IdBilling)
|
||||
->with('success', 'Billing berhasil diperbarui.');
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()->back()
|
||||
->with('error', 'Terjadi kesalahan: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
try {
|
||||
$billing = Billing::findOrFail($id);
|
||||
$billing->delete();
|
||||
|
||||
return redirect()->route('billing.index')
|
||||
->with('success', 'Billing berhasil dihapus.');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()
|
||||
->with('error', 'Terjadi kesalahan: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process additional payment for billing.
|
||||
*/
|
||||
public function processPayment(Request $request, string $id)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'jumlah_bayar' => 'required|numeric|min:1',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$billing = Billing::findOrFail($id);
|
||||
$billing->Dibayar += $request->jumlah_bayar;
|
||||
|
||||
// Update sisa dan status pembayaran
|
||||
$billing->updateSisa();
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('billing.show', $billing->IdBilling)
|
||||
->with('success', 'Pembayaran berhasil ditambahkan.');
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()->back()
|
||||
->with('error', 'Terjadi kesalahan: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
35
app/Http/Controllers/DashboardController.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Models\MsPasien;
|
||||
use App\Models\MsTindakan;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// Hitung total pasien terdaftar
|
||||
$totalPasien = MsPasien::count();
|
||||
|
||||
// Hitung pendapatan hari ini
|
||||
$today = Carbon::now()->format('Y-m-d');
|
||||
|
||||
// tabel transaksi yang menghubungkan tindakan dengan tanggal
|
||||
$pendapatanHariIni = DB::table('tr_tindakan')
|
||||
->join('ms_tindakan', 'tr_tindakan.IdTindakan', '=', 'ms_tindakan.IdTindakan')
|
||||
->whereDate('tr_tindakan.TanggalTindakan', $today)
|
||||
->sum('ms_tindakan.TarifTindakan');
|
||||
|
||||
// Jika tidak ada tabel transaksi, gunakan ini sebagai fallback
|
||||
if (!$pendapatanHariIni) {
|
||||
// Simulasi pendapatan hari ini
|
||||
$pendapatanHariIni = MsTindakan::sum('TarifTindakan') / 30; // rata-rata per hari
|
||||
}
|
||||
|
||||
return view('dashboard', compact('totalPasien', 'pendapatanHariIni'));
|
||||
}
|
||||
}
|
||||
66
app/Http/Controllers/LoginController.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function prosLogin(Request $request)
|
||||
{
|
||||
//validasi email dan password
|
||||
$validator = Validator::make($request->all(), [
|
||||
'email' => 'required|email',
|
||||
'password' => 'required'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'errors' => $validator->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
// Ambil hanya email dan password dari request
|
||||
$credentials = [
|
||||
'email' => $request->email,
|
||||
'password' => $request->password,
|
||||
];
|
||||
|
||||
// Auth attempt dengan email dan password
|
||||
if (Auth::attempt($credentials)) {
|
||||
return redirect()->route('master-pasien.index');
|
||||
}
|
||||
|
||||
// Cek jika email tidak ditemukan
|
||||
$user = User::where('email', $request->email)->first();
|
||||
|
||||
if (!$user) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => 'email_not_found'
|
||||
]);
|
||||
}
|
||||
|
||||
// Jika email ditemukan tetapi password salah
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => 'invalid_password'
|
||||
]);
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout();
|
||||
|
||||
return redirect()->route('login');
|
||||
}
|
||||
}
|
||||
97
app/Http/Controllers/MasterAsuransiController.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MsAsuransi;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MasterAsuransiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//get data 10
|
||||
$MsAsuransi = MsAsuransi::paginate(10);
|
||||
return view('admin.master.MsAsuransi.index', compact('MsAsuransi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.master.MsAsuransi.Input-Form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaAsuransi' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsAsuransi = new MsAsuransi();
|
||||
$MsAsuransi->NamaAsuransi = $request->NamaAsuransi;
|
||||
|
||||
$MsAsuransi->save();
|
||||
return redirect()->route('master-asuransi.index')->with('success', 'Data asuransi berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$MsAsuransi = MsAsuransi::findOrFail($id);
|
||||
return view('admin.master.MsAsuransi.show-form', compact('MsAsuransi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$MsAsuransi = MsAsuransi::findOrFail($id);
|
||||
return view('admin.master.MsAsuransi.edit-form', compact('MsAsuransi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaAsuransi' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsAsuransi = MsAsuransi::findOrFail($id);
|
||||
$MsAsuransi->NamaAsuransi = $request->NamaAsuransi;
|
||||
|
||||
$MsAsuransi->save();
|
||||
return redirect()->route('master-asuransi.index')->with('success', 'Data asuransi berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
$MsAsuransi = MsAsuransi::findOrFail($id);
|
||||
|
||||
// Check if the Asuransi is used in any Registrasi
|
||||
$dataExistsAsuransi = DB::table('tr_registrasi')->where('IdAsuransi', $MsAsuransi->IdAsuransi)->exists();
|
||||
|
||||
if ($dataExistsAsuransi) {
|
||||
return redirect()->route('master-asuransi.index')->with('error', 'Asuransi tidak dapat dihapus karena sudah terdaftar dalam registrasi');
|
||||
}
|
||||
|
||||
$MsAsuransi->delete();
|
||||
|
||||
return redirect()->route('master-asuransi.index')->with('success', 'Data asuransi berhasil dihapus');
|
||||
}
|
||||
}
|
||||
105
app/Http/Controllers/MasterPasienController.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MsPasien;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MasterPasienController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// get data 10
|
||||
$MsPasien = MsPasien::paginate(10);
|
||||
return view('admin.master.MsPasien.index', compact('MsPasien'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.master.MsPasien.Input-Form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaPasien' => 'required|string|max:255',
|
||||
'TanggalLahir' => 'required|date',
|
||||
'JenisKelamin' => 'required|string|in:Laki-laki,Perempuan'
|
||||
]);
|
||||
|
||||
$MsPasien = new MsPasien();
|
||||
$MsPasien->NamaPasien = $request->NamaPasien;
|
||||
$MsPasien->TanggalLahir = $request->TanggalLahir;
|
||||
$MsPasien->JenisKelamin = $request->JenisKelamin;
|
||||
|
||||
$MsPasien->save();
|
||||
return redirect()->route('master-pasien.index')->with('success', 'Data pasien berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$MsPasien = MsPasien::findOrFail($id);
|
||||
return view('admin.master.MsPasien.show-form', compact('MsPasien'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$MsPasien = MsPasien::findOrFail($id);
|
||||
return view('admin.master.MsPasien.edit-form', compact('MsPasien'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaPasien' => 'required|string|max:255',
|
||||
'TanggalLahir' => 'required|date',
|
||||
'JenisKelamin' => 'required|string|in:Laki-laki,Perempuan'
|
||||
]);
|
||||
|
||||
$MsPasien = MsPasien::findOrFail($id);
|
||||
$MsPasien->NamaPasien = $request->NamaPasien;
|
||||
$MsPasien->TanggalLahir = $request->TanggalLahir;
|
||||
$MsPasien->JenisKelamin = $request->JenisKelamin;
|
||||
|
||||
$MsPasien->save();
|
||||
return redirect()->route('master-pasien.index')->with('success', 'Data pasien berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
$MsPasien = MsPasien::findOrFail($id);
|
||||
|
||||
// Check if the patient has any registrations
|
||||
$dataExistsPasien = DB::table('tr_registrasi')->where('MRPasien', $MsPasien->MRPasien)->exists();
|
||||
|
||||
if ($dataExistsPasien) {
|
||||
return redirect()->route('master-pasien.index')->with('error', 'Pasien tidak dapat dihapus karena sudah terdaftar dalam registrasi');
|
||||
}
|
||||
|
||||
$MsPasien->delete();
|
||||
|
||||
return redirect()->route('master-pasien.index')->with('success', 'Data pasien berhasil dihapus');
|
||||
}
|
||||
}
|
||||
98
app/Http/Controllers/MasterPegawaiController.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MsPegawai;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MasterPegawaiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//get data 10
|
||||
$MsPegawai = MsPegawai::paginate(10);
|
||||
return view('admin.master.MsPegawai.index', compact('MsPegawai'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.master.MsPegawai.Input-Form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaPegawai' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsPegawai = new MsPegawai();
|
||||
$MsPegawai->NamaPegawai = $request->NamaPegawai;
|
||||
|
||||
$MsPegawai->save();
|
||||
return redirect()->route('master-pegawai.index')->with('success', 'Data pegawai berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$MsPegawai = MsPegawai::findOrFail($id);
|
||||
return view('admin.master.MsPegawai.show-form', compact('MsPegawai'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$MsPegawai = MsPegawai::findOrFail($id);
|
||||
return view('admin.master.MsPegawai.edit-form', compact('MsPegawai'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaPegawai' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsPegawai = MsPegawai::findOrFail($id);
|
||||
$MsPegawai->NamaPegawai = $request->NamaPegawai;
|
||||
|
||||
$MsPegawai->save();
|
||||
return redirect()->route('master-pegawai.index')->with('success', 'Data pegawai berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
$MsPegawai = MsPegawai::findOrFail($id);
|
||||
|
||||
// Check if the pegawai is used in any Registrasi
|
||||
$dataExistsPegawai = DB::table('tr_registrasi')->where('IdPegawai', $MsPegawai->IdPegawai)->exists() ||
|
||||
DB::table('tr_transaksi')->where('IdPegawai', $MsPegawai->IdPegawai)->exists();
|
||||
|
||||
if ($dataExistsPegawai) {
|
||||
return redirect()->route('master-pegawai.index')->with('error', 'Pegawai tidak dapat dihapus karena sudah terdaftar dalam registrasi atau transaksi');
|
||||
}
|
||||
|
||||
$MsPegawai->delete();
|
||||
|
||||
return redirect()->route('master-pegawai.index')->with('success', 'Data pegawai berhasil dihapus');
|
||||
}
|
||||
}
|
||||
97
app/Http/Controllers/MasterRuangPelayananController.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\MsRuangPelayanan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MasterRuangPelayananController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//get data 10
|
||||
$MsRuangPelayanan = MsRuangPelayanan::paginate(10);
|
||||
return view('admin.master.MsRuangPelayanan.index', compact('MsRuangPelayanan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.master.MsRuangPelayanan.Input-Form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaRuangPelayanan' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsRuangPelayanan = new MsRuangPelayanan();
|
||||
$MsRuangPelayanan->NamaRuangPelayanan = $request->NamaRuangPelayanan;
|
||||
|
||||
$MsRuangPelayanan->save();
|
||||
return redirect()->route('master-ruang-pelayanan.index')->with('success', 'Data pegawai berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$MsRuangPelayanan = MsRuangPelayanan::findOrFail($id);
|
||||
return view('admin.master.MsRuangPelayanan.show-form', compact('MsRuangPelayanan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$MsRuangPelayanan = MsRuangPelayanan::findOrFail($id);
|
||||
return view('admin.master.MsRuangPelayanan.edit-form', compact('MsRuangPelayanan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaRuangPelayanan' => 'required|string|max:255',
|
||||
]);
|
||||
|
||||
$MsRuangPelayanan = MsRuangPelayanan::findOrFail($id);
|
||||
$MsRuangPelayanan->NamaRuangPelayanan = $request->NamaRuangPelayanan;
|
||||
|
||||
$MsRuangPelayanan->save();
|
||||
return redirect()->route('master-ruang-pelayanan.index')->with('success', 'Data ruang pelayanan berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
$MsRuangPelayanan = MsRuangPelayanan::findOrFail($id);
|
||||
|
||||
// Check if the pegawai is used in any Registrasi
|
||||
$dataExistsRuangPelayanan = DB::table('tr_registrasi')->where('IdRuangPelayanan', $MsRuangPelayanan->IdRuangPelayanan)->exists();
|
||||
|
||||
if ($dataExistsRuangPelayanan) {
|
||||
return redirect()->route('master-ruang-pelayanan.index')->with('error', 'Ruang pelayanan tidak dapat dihapus karena sudah terdaftar dalam registrasi');
|
||||
}
|
||||
|
||||
$MsRuangPelayanan->delete();
|
||||
|
||||
return redirect()->route('master-ruang-pelayanan.index')->with('success', 'Data ruang pelayanan berhasil dihapus');
|
||||
}
|
||||
}
|
||||
101
app/Http/Controllers/MasterTindakanController.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MsTindakan;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MasterTindakanController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//get data 10
|
||||
$MsTindakan = MsTindakan::paginate(10);
|
||||
return view('admin.master.MsTindakan.index', compact('MsTindakan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.master.MsTindakan.Input-Form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaTindakan' => 'required|string|max:255',
|
||||
'TarifTindakan' => 'required|numeric'
|
||||
]);
|
||||
|
||||
$MsTindakan = new MsTindakan();
|
||||
$MsTindakan->NamaTindakan = $request->NamaTindakan;
|
||||
$MsTindakan->TarifTindakan = $request->TarifTindakan;
|
||||
|
||||
$MsTindakan->save();
|
||||
return redirect()->route('master-tindakan.index')->with('success', 'Data tindakan berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$MsTindakan = MsTindakan::findOrFail($id);
|
||||
return view('admin.master.MsTindakan.show-form', compact('MsTindakan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
$MsTindakan = MsTindakan::findOrFail($id);
|
||||
return view('admin.master.MsTindakan.edit-form', compact('MsTindakan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
$request->validate([
|
||||
'NamaTindakan' => 'required|string|max:255',
|
||||
'TarifTindakan' => 'required|numeric'
|
||||
]);
|
||||
|
||||
$MsTindakan = MsTindakan::findOrFail($id);
|
||||
$MsTindakan->NamaTindakan = $request->NamaTindakan;
|
||||
$MsTindakan->TarifTindakan = $request->TarifTindakan;
|
||||
|
||||
$MsTindakan->save();
|
||||
return redirect()->route('master-tindakan.index')->with('success', 'Data tindakan berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
$MsTindakan = MsTindakan::findOrFail($id);
|
||||
|
||||
// Check if the patient has any registrations
|
||||
$dataExistsTindakan = DB::table('tr_transaksi')->where('IdTindakan', $MsTindakan->IdTindakan)->exists();
|
||||
|
||||
if ($dataExistsTindakan) {
|
||||
return redirect()->route('master-tindakan.index')->with('error', 'tindakan tidak dapat dihapus karena sudah terdaftar dalam transaksi');
|
||||
}
|
||||
|
||||
$MsTindakan->delete();
|
||||
|
||||
return redirect()->route('master-tindakan.index')->with('success', 'Data tindakan berhasil dihapus');
|
||||
}
|
||||
}
|
||||
25
app/Http/Controllers/RegisterController.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
User::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'password' => bcrypt($request->password)
|
||||
]);
|
||||
|
||||
return redirect()->route('login')->with('success', 'Berhasil menambahkan user baru');
|
||||
}
|
||||
}
|
||||
139
app/Http/Controllers/TransaksiController.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TransaksiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$transaksi = DB::table('tr_transaksi')
|
||||
->join('tr_registrasi', 'tr_transaksi.IdRegistrasi', '=', 'tr_registrasi.IdRegistrasi')
|
||||
->join('ms_tindakan', 'tr_transaksi.IdTindakan', '=', 'ms_tindakan.IdTindakan')
|
||||
->join('ms_pegawai', 'tr_transaksi.IdPegawai', '=', 'ms_pegawai.IdPegawai')
|
||||
->select(
|
||||
'tr_transaksi.IdTransaksi',
|
||||
'tr_transaksi.JmlTindakan',
|
||||
'tr_transaksi.created_at',
|
||||
'tr_registrasi.NomorKartuAsuransi',
|
||||
'ms_tindakan.NamaTindakan',
|
||||
'ms_pegawai.NamaPegawai'
|
||||
)
|
||||
->paginate(10);
|
||||
|
||||
return view('admin.transaksi.TrTransaksi.index', compact('transaksi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
// Query database untuk mendapatkan data yang diperlukan di form
|
||||
$registrasi = DB::table('tr_registrasi')->get();
|
||||
$tindakan = DB::table('ms_tindakan')->get();
|
||||
$pegawai = DB::table('ms_pegawai')->get();
|
||||
|
||||
return view('admin.transaksi.TrTransaksi.Input-form', compact('registrasi', 'tindakan', 'pegawai'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Validasi data
|
||||
$request->validate([
|
||||
'IdRegistrasi' => 'required',
|
||||
'IdTindakan' => 'required',
|
||||
'JmlTindakan' => 'required|numeric',
|
||||
'IdPegawai' => 'required'
|
||||
]);
|
||||
|
||||
// Query database langsung
|
||||
DB::table('tr_transaksi')->insert([
|
||||
'IdRegistrasi' => $request->IdRegistrasi,
|
||||
'IdTindakan' => $request->IdTindakan,
|
||||
'JmlTindakan' => $request->JmlTindakan,
|
||||
'IdPegawai' => $request->IdPegawai,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now()
|
||||
]);
|
||||
|
||||
return redirect()->route('transaksi.index')->with('success', 'Transaksi berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
// Query database langsung
|
||||
$transaksi = DB::table('tr_transaksi')
|
||||
->join('tr_registrasi', 'tr_transaksi.IdRegistrasi', '=', 'tr_registrasi.IdRegistrasi')
|
||||
->join('ms_tindakan', 'tr_transaksi.IdTindakan', '=', 'ms_tindakan.IdTindakan')
|
||||
->join('ms_pegawai', 'tr_transaksi.IdPegawai', '=', 'ms_pegawai.IdPegawai')
|
||||
->select('tr_transaksi.*', 'tr_registrasi.NoRegistrasi', 'ms_tindakan.NamaTindakan', 'ms_pegawai.NamaPegawai')
|
||||
->where('tr_transaksi.IdTransaksi', $id)
|
||||
->first();
|
||||
|
||||
return view('admin.transaksi.TrTransaksi.show-form', compact('transaksi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
// Query database untuk mendapatkan data transaksi
|
||||
$transaksi = DB::table('tr_transaksi')->where('IdTransaksi', $id)->first();
|
||||
$registrasi = DB::table('tr_registrasi')->get();
|
||||
$tindakan = DB::table('ms_tindakan')->get();
|
||||
$pegawai = DB::table('ms_pegawai')->get();
|
||||
|
||||
return view('admin.transaksi.TrTransaksi.edit-form', compact('transaksi', 'registrasi', 'tindakan', 'pegawai'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
// Validasi data
|
||||
$request->validate([
|
||||
'IdRegistrasi' => 'required',
|
||||
'IdTindakan' => 'required',
|
||||
'JmlTindakan' => 'required|numeric',
|
||||
'IdPegawai' => 'required'
|
||||
]);
|
||||
|
||||
// Query database langsung
|
||||
DB::table('tr_transaksi')
|
||||
->where('IdTransaksi', $id)
|
||||
->update([
|
||||
'IdRegistrasi' => $request->IdRegistrasi,
|
||||
'IdTindakan' => $request->IdTindakan,
|
||||
'JmlTindakan' => $request->JmlTindakan,
|
||||
'IdPegawai' => $request->IdPegawai,
|
||||
'updated_at' => now()
|
||||
]);
|
||||
|
||||
return redirect()->route('transaksi.index')->with('success', 'Transaksi berhasil diperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
// Query database langsung
|
||||
DB::table('tr_transaksi')->where('IdTransaksi', $id)->delete();
|
||||
|
||||
return redirect()->route('transaksi.index')->with('success', 'Transaksi berhasil dihapus');
|
||||
}
|
||||
}
|
||||
156
app/Http/Controllers/TransaksiRegistrasiController.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MsPasien;
|
||||
use App\Models\MsPegawai;
|
||||
use App\Models\MsAsuransi;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\MsRuangPelayanan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TransaksiRegistrasiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$TrRegistrasi = DB::table('tr_registrasi')
|
||||
->join('ms_pasien', 'tr_registrasi.MRPasien', '=', 'ms_pasien.MRPasien')
|
||||
->join('ms_asuransi', 'tr_registrasi.IdAsuransi', '=', 'ms_asuransi.IdAsuransi')
|
||||
->join('ms_pegawai', 'tr_registrasi.IdPegawai', '=', 'ms_pegawai.IdPegawai')
|
||||
->join('ms_ruang_pelayanan', 'tr_registrasi.IdRuangPelayanan', '=', 'ms_ruang_pelayanan.IdRuangPelayanan')
|
||||
->select(
|
||||
'tr_registrasi.IdRegistrasi',
|
||||
'tr_registrasi.TanggalRegistrasi',
|
||||
'ms_pasien.NamaPasien',
|
||||
'ms_asuransi.NamaAsuransi',
|
||||
'ms_pegawai.NamaPegawai',
|
||||
'ms_ruang_pelayanan.NamaRuangPelayanan'
|
||||
)
|
||||
->orderBy('tr_registrasi.TanggalRegistrasi', 'desc')
|
||||
->paginate(10);
|
||||
|
||||
return view('admin.transaksi.TrRegistrasi.index', compact('TrRegistrasi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$MsPasien = MsPasien::all();
|
||||
$MsAsuransi = MsAsuransi::all();
|
||||
$MsPegawai = MsPegawai::all();
|
||||
$MsRuangPelayanan = MsRuangPelayanan::all();
|
||||
return view('admin.transaksi.TrRegistrasi.Input-form', compact('MsPasien', 'MsAsuransi', 'MsPegawai', 'MsRuangPelayanan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'TanggalRegistrasi' => 'required|date',
|
||||
'MRPasien' => 'required',
|
||||
'NomorKartuAsuransi' => 'nullable|string',
|
||||
'IdAsuransi' => 'nullable',
|
||||
'IdPegawai' => 'required',
|
||||
'IdRuangPelayanan' => 'required',
|
||||
]);
|
||||
|
||||
// Menggunakan Query Builder untuk insert data
|
||||
DB::table('tr_registrasi')->insert([
|
||||
'TanggalRegistrasi' => $validated['TanggalRegistrasi'],
|
||||
'MRPasien' => $validated['MRPasien'],
|
||||
'NomorKartuAsuransi' => $validated['NomorKartuAsuransi'],
|
||||
'IdAsuransi' => $validated['IdAsuransi'],
|
||||
'IdPegawai' => $validated['IdPegawai'],
|
||||
'IdRuangPelayanan' => $validated['IdRuangPelayanan'],
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
return redirect()->route('transaksi-registrasi.index')->with('success', 'Data registrasi berhasil ditambahkan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$registrasi = DB::table('tr_registrasi')
|
||||
->join('ms_pasien', 'tr_registrasi.MRPasien', '=', 'ms_pasien.MRPasien')
|
||||
->join('ms_asuransi', 'tr_registrasi.IdAsuransi', '=', 'ms_asuransi.IdAsuransi')
|
||||
->join('ms_pegawai', 'tr_registrasi.IdPegawai', '=', 'ms_pegawai.IdPegawai')
|
||||
->join('ms_ruang_pelayanan', 'tr_registrasi.IdRuangPelayanan', '=', 'ms_ruang_pelayanan.IdRuangPelayanan')
|
||||
->select(
|
||||
'tr_registrasi.*',
|
||||
'ms_pasien.NamaPasien',
|
||||
'ms_asuransi.NamaAsuransi',
|
||||
'ms_pegawai.NamaPegawai',
|
||||
'ms_ruang_pelayanan.NamaRuangPelayanan'
|
||||
)
|
||||
->where('tr_registrasi.IdRegistrasi', $id)
|
||||
->first();
|
||||
|
||||
return view('admin.transaksi.TrRegistrasi.show-form', compact('registrasi'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$registrasi = DB::table('tr_registrasi')->where('IdRegistrasi', $id)->first();
|
||||
$MsPasien = MsPasien::all();
|
||||
$MsAsuransi = MsAsuransi::all();
|
||||
$MsPegawai = MsPegawai::all();
|
||||
$MsRuangPelayanan = MsRuangPelayanan::all();
|
||||
|
||||
return view('admin.transaksi.TrRegistrasi.edit-form', compact('registrasi', 'MsPasien', 'MsAsuransi', 'MsPegawai', 'MsRuangPelayanan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'TanggalRegistrasi' => 'required|date',
|
||||
'MRPasien' => 'required',
|
||||
'NomorKartuAsuransi' => 'nullable|string',
|
||||
'IdAsuransi' => 'nullable',
|
||||
'IdPegawai' => 'required',
|
||||
'IdRuangPelayanan' => 'required',
|
||||
]);
|
||||
|
||||
// Menggunakan Query Builder untuk update data
|
||||
DB::table('tr_registrasi')
|
||||
->where('IdRegistrasi', $id)
|
||||
->update([
|
||||
'TanggalRegistrasi' => $validated['TanggalRegistrasi'],
|
||||
'MRPasien' => $validated['MRPasien'],
|
||||
'NomorKartuAsuransi' => $validated['NomorKartuAsuransi'],
|
||||
'IdAsuransi' => $validated['IdAsuransi'],
|
||||
'IdPegawai' => $validated['IdPegawai'],
|
||||
'IdRuangPelayanan' => $validated['IdRuangPelayanan'],
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
return redirect()->route('transaksi-registrasi.index')->with('success', 'Data registrasi berhasil dperbarui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
DB::table('tr_registrasi')->where('IdRegistrasi', $id)->delete();
|
||||
|
||||
return redirect()->route('transaksi-registrasi.index')
|
||||
->with('success', 'Data Registrasi berhasil dihapus');
|
||||
}
|
||||
}
|
||||
53
app/Models/Billing.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Billing extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'billing';
|
||||
protected $primaryKey = 'IdBilling';
|
||||
|
||||
protected $fillable = [
|
||||
'IdRegistrasi',
|
||||
'TanggalBilling',
|
||||
'TotalBiaya',
|
||||
'Dibayar',
|
||||
'Sisa',
|
||||
'StatusPembayaran',
|
||||
'Keterangan'
|
||||
];
|
||||
|
||||
public function registrasi()
|
||||
{
|
||||
return $this->belongsTo(TrRegistrasi::class, 'IdRegistrasi', 'IdRegistrasi');
|
||||
}
|
||||
|
||||
// Mendapatkan detail transaksi untuk billing ini
|
||||
public function getTransaksiDetails()
|
||||
{
|
||||
return $this->registrasi->transaksi;
|
||||
}
|
||||
|
||||
// Menghitung total biaya dari semua transaksi
|
||||
public function calculateTotalBiaya()
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->getTransaksiDetails() as $transaksi) {
|
||||
$total += $transaksi->tindakan->TarifTindakan * $transaksi->JmlTindakan;
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
// Mengupdate sisa pembayaran
|
||||
public function updateSisa()
|
||||
{
|
||||
$this->Sisa = $this->TotalBiaya - $this->Dibayar;
|
||||
$this->StatusPembayaran = ($this->Sisa <= 0) ? 'Lunas' : 'Belum Lunas';
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
18
app/Models/MsAsuransi.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class MsAsuransi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ms_asuransi';
|
||||
protected $primaryKey = 'IdAsuransi';
|
||||
|
||||
protected $fillable = [
|
||||
'NamaAsuransi'
|
||||
];
|
||||
}
|
||||
20
app/Models/MsPasien.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class MsPasien extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ms_pasien';
|
||||
protected $primaryKey = 'MRPasien';
|
||||
|
||||
protected $fillable = [
|
||||
'NamaPasien',
|
||||
'TanggalLahir',
|
||||
'JenisKelamin'
|
||||
];
|
||||
}
|
||||
18
app/Models/MsPegawai.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class MsPegawai extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ms_pegawai';
|
||||
protected $primaryKey = 'IdPegawai';
|
||||
|
||||
protected $fillable = [
|
||||
'NamaPegawai'
|
||||
];
|
||||
}
|
||||
18
app/Models/MsRuangPelayanan.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class MsRuangPelayanan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ms_ruang_pelayanan';
|
||||
protected $primaryKey = 'IdRuangPelayanan';
|
||||
|
||||
protected $fillable = [
|
||||
'NamaRuangPelayanan'
|
||||
];
|
||||
}
|
||||
19
app/Models/MsTindakan.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class MsTindakan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ms_tindakan';
|
||||
protected $primaryKey = 'IdTindakan';
|
||||
|
||||
protected $fillable = [
|
||||
'NamaTindakan',
|
||||
'TarifTindakan'
|
||||
];
|
||||
}
|
||||
23
app/Models/TrRegistrasi.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class TrRegistrasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tr_registrasi';
|
||||
protected $primaryKey = 'IdRegistrasi';
|
||||
|
||||
protected $fillable = [
|
||||
'TanggalRegistrasi',
|
||||
'MRPasien',
|
||||
'NomorKartuAsuransi',
|
||||
'IdAsuransi',
|
||||
'IdPegawai',
|
||||
'IdRuangPelayanan'
|
||||
];
|
||||
}
|
||||
31
app/Models/TrTindakan.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class TrTindakan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tr_tindakan';
|
||||
protected $primaryKey = 'IdTransaksi';
|
||||
|
||||
protected $fillable = [
|
||||
'MRPasien',
|
||||
'IdTindakan',
|
||||
'TanggalTindakan',
|
||||
'Keterangan'
|
||||
];
|
||||
|
||||
public function pasien()
|
||||
{
|
||||
return $this->belongsTo(MsPasien::class, 'MRPasien', 'MRPasien');
|
||||
}
|
||||
|
||||
public function tindakan()
|
||||
{
|
||||
return $this->belongsTo(MsTindakan::class, 'IdTindakan', 'IdTindakan');
|
||||
}
|
||||
}
|
||||
21
app/Models/TrTransaksi.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class TrTransaksi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tr_transaksi';
|
||||
protected $primaryKey = 'IdTransaksi';
|
||||
|
||||
protected $fillable = [
|
||||
'IdRegistrasi',
|
||||
'IdTindakan',
|
||||
'JmlTindakan',
|
||||
'IdPegawai'
|
||||
];
|
||||
}
|
||||
48
app/Models/User.php
Normal file
@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
24
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
26
app/View/Components/header.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class header extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.header');
|
||||
}
|
||||
}
|
||||
26
app/View/Components/mobileSidebar.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class mobileSidebar extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.mobile-sidebar');
|
||||
}
|
||||
}
|
||||
26
app/View/Components/sidebar.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class sidebar extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.sidebar');
|
||||
}
|
||||
}
|
||||
18
artisan
Normal file
@ -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);
|
||||
18
bootstrap/app.php
Normal file
@ -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) {
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
})->create();
|
||||
2
bootstrap/cache/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
5
bootstrap/providers.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
];
|
||||
76
composer.json
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"$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",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/tinker": "^2.10.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.15",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.13",
|
||||
"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": {
|
||||
"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"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||
],
|
||||
"test": [
|
||||
"@php artisan config:clear --ansi",
|
||||
"@php artisan test"
|
||||
]
|
||||
},
|
||||
"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
|
||||
}
|
||||
8240
composer.lock
generated
Normal file
126
config/app.php
Normal file
@ -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' => 'Asia/Jakarta',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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(',', 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'),
|
||||
],
|
||||
|
||||
];
|
||||
115
config/auth.php
Normal file
@ -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 amount 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),
|
||||
|
||||
];
|
||||
108
config/cache.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?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", "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',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||
|
||||
];
|
||||
174
config/database.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?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,
|
||||
],
|
||||
|
||||
'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([
|
||||
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([
|
||||
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' => '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(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'),
|
||||
],
|
||||
|
||||
'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'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
80
config/filesystems.php
Normal file
@ -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' => env('APP_URL').'/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'),
|
||||
],
|
||||
|
||||
];
|
||||
132
config/logging.php
Normal file
@ -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(',', 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'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
118
config/mail.php
Normal file
@ -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(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'),
|
||||
],
|
||||
|
||||
];
|
||||
112
config/queue.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?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", "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,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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',
|
||||
],
|
||||
|
||||
];
|
||||
38
config/services.php
Normal file
@ -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' => [
|
||||
'token' => env('POSTMARK_TOKEN'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'key' => env('RESEND_KEY'),
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'notifications' => [
|
||||
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
217
config/session.php
Normal file
@ -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", "apc",
|
||||
| "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: "apc", "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(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 and all 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),
|
||||
|
||||
];
|
||||
1
database/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
44
database/factories/UserFactory.php
Normal file
@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@ -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');
|
||||
}
|
||||
};
|
||||
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
@ -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');
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
@ -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,30 @@
|
||||
<?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('ms_pasien', function (Blueprint $table) {
|
||||
$table->id('MRPasien')->primary();
|
||||
$table->string('NamaPasien');
|
||||
$table->date('TanggalLahir');
|
||||
$table->string('JenisKelamin');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('ms_pasien');
|
||||
}
|
||||
};
|
||||
@ -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::create('ms_asuransi', function (Blueprint $table) {
|
||||
$table->id('IdAsuransi')->primary();
|
||||
$table->string('NamaAsuransi');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ms_asuransi');
|
||||
}
|
||||
};
|
||||
@ -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::create('ms_pegawai', function (Blueprint $table) {
|
||||
$table->id('IdPegawai')->primary();
|
||||
$table->string('NamaPegawai');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ms_pegawai');
|
||||
}
|
||||
};
|
||||
@ -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::create('ms_ruang_pelayanan', function (Blueprint $table) {
|
||||
$table->id('IdRuangPelayanan')->primary();
|
||||
$table->string('NamaRuangPelayanan');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ms_ruang_pelayanan');
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,39 @@
|
||||
<?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('tr_registrasi', function (Blueprint $table) {
|
||||
$table->id('IdRegistrasi')->primary();
|
||||
$table->date('TanggalRegistrasi');
|
||||
$table->unsignedBigInteger('MRPasien');
|
||||
$table->string('NomorKartuAsuransi')->nullable();
|
||||
$table->unsignedBigInteger('IdAsuransi')->nullable();
|
||||
$table->unsignedBigInteger('IdPegawai');
|
||||
$table->unsignedBigInteger('IdRuangPelayanan');
|
||||
$table->timestamps();
|
||||
|
||||
// Foreign keys
|
||||
$table->foreign('MRPasien')->references('MRPasien')->on('ms_pasien');
|
||||
$table->foreign('IdAsuransi')->references('IdAsuransi')->on('ms_asuransi');
|
||||
$table->foreign('IdPegawai')->references('IdPegawai')->on('ms_pegawai');
|
||||
$table->foreign('IdRuangPelayanan')->references('IdRuangPelayanan')->on('ms_ruang_pelayanan');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tr_registrasi');
|
||||
}
|
||||
};
|
||||
@ -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('ms_tindakan', function (Blueprint $table) {
|
||||
$table->id('IdTindakan')->primary();
|
||||
$table->string('NamaTindakan');
|
||||
$table->decimal('TarifTindakan', 12, 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ms_tindakan');
|
||||
}
|
||||
};
|
||||
@ -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('tr_transaksi', function (Blueprint $table) {
|
||||
$table->id('IdTransaksi')->primary();
|
||||
$table->unsignedBigInteger('IdRegistrasi');
|
||||
$table->unsignedBigInteger('IdTindakan');
|
||||
$table->integer('JmlTindakan')->default(1);
|
||||
$table->unsignedBigInteger('IdPegawai');
|
||||
$table->timestamps();
|
||||
|
||||
// Foreign keys
|
||||
$table->foreign('IdRegistrasi')->references('IdRegistrasi')->on('tr_registrasi');
|
||||
$table->foreign('IdTindakan')->references('IdTindakan')->on('ms_tindakan');
|
||||
$table->foreign('IdPegawai')->references('IdPegawai')->on('ms_pegawai');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tr_transaksi');
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,37 @@
|
||||
<?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('billing', function (Blueprint $table) {
|
||||
$table->id('IdBilling');
|
||||
$table->unsignedBigInteger('IdRegistrasi');
|
||||
$table->date('TanggalBilling');
|
||||
$table->decimal('TotalBiaya', 12, 2);
|
||||
$table->decimal('Dibayar', 12, 2)->default(0);
|
||||
$table->decimal('Sisa', 12, 2)->default(0);
|
||||
$table->enum('StatusPembayaran', ['Belum Lunas', 'Lunas'])->default('Belum Lunas');
|
||||
$table->text('Keterangan')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
// Foreign key
|
||||
$table->foreign('IdRegistrasi')->references('IdRegistrasi')->on('tr_registrasi');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('billing');
|
||||
}
|
||||
};
|
||||
30
database/migrations/2025_04_26_003154_password_resets.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?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
|
||||
{
|
||||
if (!Schema::hasTable('password_resets')) {
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
};
|
||||
@ -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('tr_tindakan', function (Blueprint $table) {
|
||||
$table->id('IdTransaksi');
|
||||
$table->unsignedBigInteger('MRPasien');
|
||||
$table->unsignedBigInteger('IdTindakan');
|
||||
$table->date('TanggalTindakan');
|
||||
$table->text('Keterangan')->nullable();
|
||||
|
||||
// Foreign key constraints
|
||||
$table->foreign('MRPasien')->references('MRPasien')->on('ms_pasien');
|
||||
$table->foreign('IdTindakan')->references('IdTindakan')->on('ms_tindakan');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tr_tindakan');
|
||||
}
|
||||
};
|
||||
23
database/seeders/DatabaseSeeder.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
}
|
||||
}
|
||||
575
databases/instalasi-simrs.sql
Normal file
@ -0,0 +1,575 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.1
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: 127.0.0.1
|
||||
-- Waktu pembuatan: 27 Apr 2025 pada 17.34
|
||||
-- Versi server: 10.4.28-MariaDB
|
||||
-- Versi PHP: 8.0.28
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Database: `instalasi-simrs`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `billing`
|
||||
--
|
||||
|
||||
CREATE TABLE `billing` (
|
||||
`IdBilling` bigint(20) UNSIGNED NOT NULL,
|
||||
`IdRegistrasi` bigint(20) UNSIGNED NOT NULL,
|
||||
`TanggalBilling` date NOT NULL,
|
||||
`TotalBiaya` decimal(12,2) NOT NULL,
|
||||
`Dibayar` decimal(12,2) NOT NULL DEFAULT 0.00,
|
||||
`Sisa` decimal(12,2) NOT NULL DEFAULT 0.00,
|
||||
`StatusPembayaran` enum('Belum Lunas','Lunas') NOT NULL DEFAULT 'Belum Lunas',
|
||||
`Keterangan` text DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `cache`
|
||||
--
|
||||
|
||||
CREATE TABLE `cache` (
|
||||
`key` varchar(255) NOT NULL,
|
||||
`value` mediumtext NOT NULL,
|
||||
`expiration` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `cache_locks`
|
||||
--
|
||||
|
||||
CREATE TABLE `cache_locks` (
|
||||
`key` varchar(255) NOT NULL,
|
||||
`owner` varchar(255) NOT NULL,
|
||||
`expiration` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `failed_jobs`
|
||||
--
|
||||
|
||||
CREATE TABLE `failed_jobs` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`uuid` varchar(255) NOT NULL,
|
||||
`connection` text NOT NULL,
|
||||
`queue` text NOT NULL,
|
||||
`payload` longtext NOT NULL,
|
||||
`exception` longtext NOT NULL,
|
||||
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `jobs`
|
||||
--
|
||||
|
||||
CREATE TABLE `jobs` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`queue` varchar(255) NOT NULL,
|
||||
`payload` longtext NOT NULL,
|
||||
`attempts` tinyint(3) UNSIGNED NOT NULL,
|
||||
`reserved_at` int(10) UNSIGNED DEFAULT NULL,
|
||||
`available_at` int(10) UNSIGNED NOT NULL,
|
||||
`created_at` int(10) UNSIGNED NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `job_batches`
|
||||
--
|
||||
|
||||
CREATE TABLE `job_batches` (
|
||||
`id` varchar(255) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`total_jobs` int(11) NOT NULL,
|
||||
`pending_jobs` int(11) NOT NULL,
|
||||
`failed_jobs` int(11) NOT NULL,
|
||||
`failed_job_ids` longtext NOT NULL,
|
||||
`options` mediumtext DEFAULT NULL,
|
||||
`cancelled_at` int(11) DEFAULT NULL,
|
||||
`created_at` int(11) NOT NULL,
|
||||
`finished_at` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `migrations`
|
||||
--
|
||||
|
||||
CREATE TABLE `migrations` (
|
||||
`id` int(10) UNSIGNED NOT NULL,
|
||||
`migration` varchar(255) NOT NULL,
|
||||
`batch` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Dumping data untuk tabel `migrations`
|
||||
--
|
||||
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
|
||||
(1, '0001_01_01_000000_create_users_table', 1),
|
||||
(2, '0001_01_01_000001_create_cache_table', 1),
|
||||
(3, '0001_01_01_000002_create_jobs_table', 1),
|
||||
(4, '2025_04_25_162039_create_ms_pasien_table', 1),
|
||||
(5, '2025_04_25_162239_create_ms_asuransi_table', 1),
|
||||
(6, '2025_04_25_162500_create_ms_pegawai_table', 1),
|
||||
(7, '2025_04_25_162626_create_ms_ruang_pelayanan_table', 1),
|
||||
(8, '2025_04_25_162751_create_tr_registrasi_table', 1),
|
||||
(9, '2025_04_25_162848_create_ms_tindakan_table', 1),
|
||||
(10, '2025_04_25_163033_create_tr_transaksi_table', 1),
|
||||
(11, '2025_04_25_163200_create_billing_table', 1),
|
||||
(12, '2025_04_26_003154_password_resets', 1),
|
||||
(13, '2025_04_27_220814_create_tr_tindakan_table', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `ms_asuransi`
|
||||
--
|
||||
|
||||
CREATE TABLE `ms_asuransi` (
|
||||
`IdAsuransi` bigint(20) UNSIGNED NOT NULL,
|
||||
`NamaAsuransi` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `ms_pasien`
|
||||
--
|
||||
|
||||
CREATE TABLE `ms_pasien` (
|
||||
`MRPasien` bigint(20) UNSIGNED NOT NULL,
|
||||
`NamaPasien` varchar(255) NOT NULL,
|
||||
`TanggalLahir` date NOT NULL,
|
||||
`JenisKelamin` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `ms_pegawai`
|
||||
--
|
||||
|
||||
CREATE TABLE `ms_pegawai` (
|
||||
`IdPegawai` bigint(20) UNSIGNED NOT NULL,
|
||||
`NamaPegawai` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `ms_ruang_pelayanan`
|
||||
--
|
||||
|
||||
CREATE TABLE `ms_ruang_pelayanan` (
|
||||
`IdRuangPelayanan` bigint(20) UNSIGNED NOT NULL,
|
||||
`NamaRuangPelayanan` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `ms_tindakan`
|
||||
--
|
||||
|
||||
CREATE TABLE `ms_tindakan` (
|
||||
`IdTindakan` bigint(20) UNSIGNED NOT NULL,
|
||||
`NamaTindakan` varchar(255) NOT NULL,
|
||||
`TarifTindakan` decimal(12,2) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `password_resets`
|
||||
--
|
||||
|
||||
CREATE TABLE `password_resets` (
|
||||
`email` varchar(255) NOT NULL,
|
||||
`token` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `password_reset_tokens`
|
||||
--
|
||||
|
||||
CREATE TABLE `password_reset_tokens` (
|
||||
`email` varchar(255) NOT NULL,
|
||||
`token` varchar(255) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `sessions`
|
||||
--
|
||||
|
||||
CREATE TABLE `sessions` (
|
||||
`id` varchar(255) NOT NULL,
|
||||
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
|
||||
`ip_address` varchar(45) DEFAULT NULL,
|
||||
`user_agent` text DEFAULT NULL,
|
||||
`payload` longtext NOT NULL,
|
||||
`last_activity` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `tr_registrasi`
|
||||
--
|
||||
|
||||
CREATE TABLE `tr_registrasi` (
|
||||
`IdRegistrasi` bigint(20) UNSIGNED NOT NULL,
|
||||
`TanggalRegistrasi` date NOT NULL,
|
||||
`MRPasien` bigint(20) UNSIGNED NOT NULL,
|
||||
`NomorKartuAsuransi` varchar(255) DEFAULT NULL,
|
||||
`IdAsuransi` bigint(20) UNSIGNED DEFAULT NULL,
|
||||
`IdPegawai` bigint(20) UNSIGNED NOT NULL,
|
||||
`IdRuangPelayanan` bigint(20) UNSIGNED NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `tr_tindakan`
|
||||
--
|
||||
|
||||
CREATE TABLE `tr_tindakan` (
|
||||
`IdTransaksi` bigint(20) UNSIGNED NOT NULL,
|
||||
`MRPasien` bigint(20) UNSIGNED NOT NULL,
|
||||
`IdTindakan` bigint(20) UNSIGNED NOT NULL,
|
||||
`TanggalTindakan` date NOT NULL,
|
||||
`Keterangan` text DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `tr_transaksi`
|
||||
--
|
||||
|
||||
CREATE TABLE `tr_transaksi` (
|
||||
`IdTransaksi` bigint(20) UNSIGNED NOT NULL,
|
||||
`IdRegistrasi` bigint(20) UNSIGNED NOT NULL,
|
||||
`IdTindakan` bigint(20) UNSIGNED NOT NULL,
|
||||
`JmlTindakan` int(11) NOT NULL DEFAULT 1,
|
||||
`IdPegawai` bigint(20) UNSIGNED NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktur dari tabel `users`
|
||||
--
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`email` varchar(255) NOT NULL,
|
||||
`email_verified_at` timestamp NULL DEFAULT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`remember_token` varchar(100) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `billing`
|
||||
--
|
||||
ALTER TABLE `billing`
|
||||
ADD PRIMARY KEY (`IdBilling`),
|
||||
ADD KEY `billing_idregistrasi_foreign` (`IdRegistrasi`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `cache`
|
||||
--
|
||||
ALTER TABLE `cache`
|
||||
ADD PRIMARY KEY (`key`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `cache_locks`
|
||||
--
|
||||
ALTER TABLE `cache_locks`
|
||||
ADD PRIMARY KEY (`key`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `failed_jobs`
|
||||
--
|
||||
ALTER TABLE `failed_jobs`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `jobs`
|
||||
--
|
||||
ALTER TABLE `jobs`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `jobs_queue_index` (`queue`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `job_batches`
|
||||
--
|
||||
ALTER TABLE `job_batches`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `migrations`
|
||||
--
|
||||
ALTER TABLE `migrations`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `ms_asuransi`
|
||||
--
|
||||
ALTER TABLE `ms_asuransi`
|
||||
ADD PRIMARY KEY (`IdAsuransi`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `ms_pasien`
|
||||
--
|
||||
ALTER TABLE `ms_pasien`
|
||||
ADD PRIMARY KEY (`MRPasien`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `ms_pegawai`
|
||||
--
|
||||
ALTER TABLE `ms_pegawai`
|
||||
ADD PRIMARY KEY (`IdPegawai`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `ms_ruang_pelayanan`
|
||||
--
|
||||
ALTER TABLE `ms_ruang_pelayanan`
|
||||
ADD PRIMARY KEY (`IdRuangPelayanan`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `ms_tindakan`
|
||||
--
|
||||
ALTER TABLE `ms_tindakan`
|
||||
ADD PRIMARY KEY (`IdTindakan`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `password_resets`
|
||||
--
|
||||
ALTER TABLE `password_resets`
|
||||
ADD KEY `password_resets_email_index` (`email`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `password_reset_tokens`
|
||||
--
|
||||
ALTER TABLE `password_reset_tokens`
|
||||
ADD PRIMARY KEY (`email`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `sessions`
|
||||
--
|
||||
ALTER TABLE `sessions`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `sessions_user_id_index` (`user_id`),
|
||||
ADD KEY `sessions_last_activity_index` (`last_activity`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `tr_registrasi`
|
||||
--
|
||||
ALTER TABLE `tr_registrasi`
|
||||
ADD PRIMARY KEY (`IdRegistrasi`),
|
||||
ADD KEY `tr_registrasi_mrpasien_foreign` (`MRPasien`),
|
||||
ADD KEY `tr_registrasi_idasuransi_foreign` (`IdAsuransi`),
|
||||
ADD KEY `tr_registrasi_idpegawai_foreign` (`IdPegawai`),
|
||||
ADD KEY `tr_registrasi_idruangpelayanan_foreign` (`IdRuangPelayanan`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `tr_tindakan`
|
||||
--
|
||||
ALTER TABLE `tr_tindakan`
|
||||
ADD PRIMARY KEY (`IdTransaksi`),
|
||||
ADD KEY `tr_tindakan_mrpasien_foreign` (`MRPasien`),
|
||||
ADD KEY `tr_tindakan_idtindakan_foreign` (`IdTindakan`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `tr_transaksi`
|
||||
--
|
||||
ALTER TABLE `tr_transaksi`
|
||||
ADD PRIMARY KEY (`IdTransaksi`),
|
||||
ADD KEY `tr_transaksi_idregistrasi_foreign` (`IdRegistrasi`),
|
||||
ADD KEY `tr_transaksi_idtindakan_foreign` (`IdTindakan`),
|
||||
ADD KEY `tr_transaksi_idpegawai_foreign` (`IdPegawai`);
|
||||
|
||||
--
|
||||
-- Indeks untuk tabel `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `users_email_unique` (`email`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel yang dibuang
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `billing`
|
||||
--
|
||||
ALTER TABLE `billing`
|
||||
MODIFY `IdBilling` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `failed_jobs`
|
||||
--
|
||||
ALTER TABLE `failed_jobs`
|
||||
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `jobs`
|
||||
--
|
||||
ALTER TABLE `jobs`
|
||||
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `migrations`
|
||||
--
|
||||
ALTER TABLE `migrations`
|
||||
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `ms_asuransi`
|
||||
--
|
||||
ALTER TABLE `ms_asuransi`
|
||||
MODIFY `IdAsuransi` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `ms_pasien`
|
||||
--
|
||||
ALTER TABLE `ms_pasien`
|
||||
MODIFY `MRPasien` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `ms_pegawai`
|
||||
--
|
||||
ALTER TABLE `ms_pegawai`
|
||||
MODIFY `IdPegawai` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `ms_ruang_pelayanan`
|
||||
--
|
||||
ALTER TABLE `ms_ruang_pelayanan`
|
||||
MODIFY `IdRuangPelayanan` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `ms_tindakan`
|
||||
--
|
||||
ALTER TABLE `ms_tindakan`
|
||||
MODIFY `IdTindakan` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `tr_registrasi`
|
||||
--
|
||||
ALTER TABLE `tr_registrasi`
|
||||
MODIFY `IdRegistrasi` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `tr_tindakan`
|
||||
--
|
||||
ALTER TABLE `tr_tindakan`
|
||||
MODIFY `IdTransaksi` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `tr_transaksi`
|
||||
--
|
||||
ALTER TABLE `tr_transaksi`
|
||||
MODIFY `IdTransaksi` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT untuk tabel `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
|
||||
--
|
||||
|
||||
--
|
||||
-- Ketidakleluasaan untuk tabel `billing`
|
||||
--
|
||||
ALTER TABLE `billing`
|
||||
ADD CONSTRAINT `billing_idregistrasi_foreign` FOREIGN KEY (`IdRegistrasi`) REFERENCES `tr_registrasi` (`IdRegistrasi`);
|
||||
|
||||
--
|
||||
-- Ketidakleluasaan untuk tabel `tr_registrasi`
|
||||
--
|
||||
ALTER TABLE `tr_registrasi`
|
||||
ADD CONSTRAINT `tr_registrasi_idasuransi_foreign` FOREIGN KEY (`IdAsuransi`) REFERENCES `ms_asuransi` (`IdAsuransi`),
|
||||
ADD CONSTRAINT `tr_registrasi_idpegawai_foreign` FOREIGN KEY (`IdPegawai`) REFERENCES `ms_pegawai` (`IdPegawai`),
|
||||
ADD CONSTRAINT `tr_registrasi_idruangpelayanan_foreign` FOREIGN KEY (`IdRuangPelayanan`) REFERENCES `ms_ruang_pelayanan` (`IdRuangPelayanan`),
|
||||
ADD CONSTRAINT `tr_registrasi_mrpasien_foreign` FOREIGN KEY (`MRPasien`) REFERENCES `ms_pasien` (`MRPasien`);
|
||||
|
||||
--
|
||||
-- Ketidakleluasaan untuk tabel `tr_tindakan`
|
||||
--
|
||||
ALTER TABLE `tr_tindakan`
|
||||
ADD CONSTRAINT `tr_tindakan_idtindakan_foreign` FOREIGN KEY (`IdTindakan`) REFERENCES `ms_tindakan` (`IdTindakan`),
|
||||
ADD CONSTRAINT `tr_tindakan_mrpasien_foreign` FOREIGN KEY (`MRPasien`) REFERENCES `ms_pasien` (`MRPasien`);
|
||||
|
||||
--
|
||||
-- Ketidakleluasaan untuk tabel `tr_transaksi`
|
||||
--
|
||||
ALTER TABLE `tr_transaksi`
|
||||
ADD CONSTRAINT `tr_transaksi_idpegawai_foreign` FOREIGN KEY (`IdPegawai`) REFERENCES `ms_pegawai` (`IdPegawai`),
|
||||
ADD CONSTRAINT `tr_transaksi_idregistrasi_foreign` FOREIGN KEY (`IdRegistrasi`) REFERENCES `tr_registrasi` (`IdRegistrasi`),
|
||||
ADD CONSTRAINT `tr_transaksi_idtindakan_foreign` FOREIGN KEY (`IdTindakan`) REFERENCES `ms_tindakan` (`IdTindakan`);
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
4613
package-lock.json
generated
Normal file
24
package.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"@tailwindcss/vite": "^4.1.4",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"axios": "^1.8.2",
|
||||
"color": "^5.0.0",
|
||||
"concurrently": "^9.0.1",
|
||||
"cssnano": "^7.0.6",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"postcss": "^8.5.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"vite": "^6.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"tailwindcss-theming": "^3.0.0-beta.3"
|
||||
}
|
||||
}
|
||||
33
phpunit.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?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="CACHE_STORE" value="array"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
<env name="PULSE_ENABLED" value="false"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
9
postcss.config.cjs
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require("tailwindcss"),
|
||||
require("autoprefixer"),
|
||||
require("cssnano")({
|
||||
preset: "default",
|
||||
}),
|
||||
],
|
||||
};
|
||||
25
public/.htaccess
Normal file
@ -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>
|
||||
1726
public/assets/css/tailwind.output.css
Normal file
BIN
public/assets/img/create-account-office-dark.jpeg
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
public/assets/img/create-account-office.jpeg
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
public/assets/img/dashboard.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
public/assets/img/forgot-password-office-dark.jpeg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
public/assets/img/forgot-password-office.jpeg
Normal file
|
After Width: | Height: | Size: 90 KiB |
1
public/assets/img/github.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
|
||||
|
After Width: | Height: | Size: 775 B |
BIN
public/assets/img/login-office-dark.jpeg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/assets/img/login-office.jpeg
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
public/assets/img/logo-rsab.jpg
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
1
public/assets/img/twitter.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>
|
||||
|
After Width: | Height: | Size: 704 B |
34
public/assets/js/charts-bars.js
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* For usage, visit Chart.js docs https://www.chartjs.org/docs/latest/
|
||||
*/
|
||||
const barConfig = {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Shoes',
|
||||
backgroundColor: '#0694a2',
|
||||
// borderColor: window.chartColors.red,
|
||||
borderWidth: 1,
|
||||
data: [-3, 14, 52, 74, 33, 90, 70],
|
||||
},
|
||||
{
|
||||
label: 'Bags',
|
||||
backgroundColor: '#7e3af2',
|
||||
// borderColor: window.chartColors.blue,
|
||||
borderWidth: 1,
|
||||
data: [66, 33, 43, 12, 54, 62, 84],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const barsCtx = document.getElementById('bars')
|
||||
window.myBar = new Chart(barsCtx, barConfig)
|
||||
71
public/assets/js/charts-lines.js
Normal file
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* For usage, visit Chart.js docs https://www.chartjs.org/docs/latest/
|
||||
*/
|
||||
const lineConfig = {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Organic',
|
||||
/**
|
||||
* These colors come from Tailwind CSS palette
|
||||
* https://tailwindcss.com/docs/customizing-colors/#default-color-palette
|
||||
*/
|
||||
backgroundColor: '#0694a2',
|
||||
borderColor: '#0694a2',
|
||||
data: [43, 48, 40, 54, 67, 73, 70],
|
||||
fill: false,
|
||||
},
|
||||
{
|
||||
label: 'Paid',
|
||||
fill: false,
|
||||
/**
|
||||
* These colors come from Tailwind CSS palette
|
||||
* https://tailwindcss.com/docs/customizing-colors/#default-color-palette
|
||||
*/
|
||||
backgroundColor: '#7e3af2',
|
||||
borderColor: '#7e3af2',
|
||||
data: [24, 50, 64, 74, 52, 51, 65],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
/**
|
||||
* Default legends are ugly and impossible to style.
|
||||
* See examples in charts.html to add your own legends
|
||||
* */
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
intersect: false,
|
||||
},
|
||||
hover: {
|
||||
mode: 'nearest',
|
||||
intersect: true,
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
display: true,
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Month',
|
||||
},
|
||||
},
|
||||
y: {
|
||||
display: true,
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Value',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// change this to the id of your chart element in HMTL
|
||||
const lineCtx = document.getElementById('line')
|
||||
window.myLine = new Chart(lineCtx, lineConfig)
|
||||
35
public/assets/js/charts-pie.js
Normal file
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* For usage, visit Chart.js docs https://www.chartjs.org/docs/latest/
|
||||
*/
|
||||
const pieConfig = {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
datasets: [
|
||||
{
|
||||
data: [33, 33, 33],
|
||||
/**
|
||||
* These colors come from Tailwind CSS palette
|
||||
* https://tailwindcss.com/docs/customizing-colors/#default-color-palette
|
||||
*/
|
||||
backgroundColor: ['#0694a2', '#1c64f2', '#7e3af2'],
|
||||
label: 'Dataset 1',
|
||||
},
|
||||
],
|
||||
labels: ['Shoes', 'Shirts', 'Bags'],
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
cutoutPercentage: 80,
|
||||
/**
|
||||
* Default legends are ugly and impossible to style.
|
||||
* See examples in charts.html to add your own legends
|
||||
* */
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// change this to the id of your chart element in HMTL
|
||||
const pieCtx = document.getElementById('pie')
|
||||
window.myPie = new Chart(pieCtx, pieConfig)
|
||||
51
public/assets/js/focus-trap.js
Normal file
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Limit focus to focusable elements inside `element`
|
||||
* @param {HTMLElement} element - DOM element to focus trap inside
|
||||
* @return {Function} cleanup function
|
||||
*/
|
||||
function focusTrap(element) {
|
||||
const focusableElements = getFocusableElements(element)
|
||||
const firstFocusableEl = focusableElements[0]
|
||||
const lastFocusableEl = focusableElements[focusableElements.length - 1]
|
||||
|
||||
// Wait for the case the element was not yet rendered
|
||||
setTimeout(() => firstFocusableEl.focus(), 50)
|
||||
|
||||
/**
|
||||
* Get all focusable elements inside `element`
|
||||
* @param {HTMLElement} element - DOM element to focus trap inside
|
||||
* @return {HTMLElement[]} List of focusable elements
|
||||
*/
|
||||
function getFocusableElements(element = document) {
|
||||
return [
|
||||
...element.querySelectorAll(
|
||||
'a, button, details, input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
||||
),
|
||||
].filter((e) => !e.hasAttribute('disabled'))
|
||||
}
|
||||
|
||||
function handleKeyDown(e) {
|
||||
const TAB = 9
|
||||
const isTab = e.key.toLowerCase() === 'tab' || e.keyCode === TAB
|
||||
|
||||
if (!isTab) return
|
||||
|
||||
if (e.shiftKey) {
|
||||
if (document.activeElement === firstFocusableEl) {
|
||||
lastFocusableEl.focus()
|
||||
e.preventDefault()
|
||||
}
|
||||
} else {
|
||||
if (document.activeElement === lastFocusableEl) {
|
||||
firstFocusableEl.focus()
|
||||
e.preventDefault()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
element.addEventListener('keydown', handleKeyDown)
|
||||
|
||||
return function cleanup() {
|
||||
element.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}
|
||||
70
public/assets/js/init-alpine.js
Normal file
@ -0,0 +1,70 @@
|
||||
function data() {
|
||||
function getThemeFromLocalStorage() {
|
||||
// if user already changed the theme, use it
|
||||
if (window.localStorage.getItem("dark")) {
|
||||
return JSON.parse(window.localStorage.getItem("dark"));
|
||||
}
|
||||
|
||||
// else return their preferences
|
||||
return (
|
||||
!!window.matchMedia &&
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
);
|
||||
}
|
||||
|
||||
function setThemeToLocalStorage(value) {
|
||||
window.localStorage.setItem("dark", value);
|
||||
}
|
||||
|
||||
return {
|
||||
dark: getThemeFromLocalStorage(),
|
||||
toggleTheme() {
|
||||
this.dark = !this.dark;
|
||||
setThemeToLocalStorage(this.dark);
|
||||
},
|
||||
isSideMenuOpen: false,
|
||||
toggleSideMenu() {
|
||||
this.isSideMenuOpen = !this.isSideMenuOpen;
|
||||
},
|
||||
closeSideMenu() {
|
||||
this.isSideMenuOpen = false;
|
||||
},
|
||||
isNotificationsMenuOpen: false,
|
||||
toggleNotificationsMenu() {
|
||||
this.isNotificationsMenuOpen = !this.isNotificationsMenuOpen;
|
||||
},
|
||||
closeNotificationsMenu() {
|
||||
this.isNotificationsMenuOpen = false;
|
||||
},
|
||||
isProfileMenuOpen: false,
|
||||
toggleProfileMenu() {
|
||||
this.isProfileMenuOpen = !this.isProfileMenuOpen;
|
||||
},
|
||||
closeProfileMenu() {
|
||||
this.isProfileMenuOpen = false;
|
||||
},
|
||||
isMasterMenuOpen: false,
|
||||
toggleMasterMenu() {
|
||||
this.isMasterMenuOpen = !this.isMasterMenuOpen;
|
||||
},
|
||||
isTransaksiMenuOpen: false,
|
||||
toggleTransaksiMenu() {
|
||||
this.isTransaksiMenuOpen = !this.isTransaksiMenuOpen;
|
||||
},
|
||||
isLaporanMenuOpen: false,
|
||||
toggleLaporanMenu() {
|
||||
this.isLaporanMenuOpen = !this.isLaporanMenuOpen;
|
||||
},
|
||||
// Modal
|
||||
isModalOpen: false,
|
||||
trapCleanup: null,
|
||||
openModal() {
|
||||
this.isModalOpen = true;
|
||||
this.trapCleanup = focusTrap(document.querySelector("#modal"));
|
||||
},
|
||||
closeModal() {
|
||||
this.isModalOpen = false;
|
||||
this.trapCleanup();
|
||||
},
|
||||
};
|
||||
}
|
||||
0
public/favicon.ico
Normal file
20
public/index.php
Normal file
@ -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());
|
||||
2
public/robots.txt
Normal file
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
3
resources/css/app.css
Normal file
@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
1
resources/js/app.js
Normal file
@ -0,0 +1 @@
|
||||
import './bootstrap';
|
||||
4
resources/js/bootstrap.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import axios from 'axios';
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
93
resources/views/admin/billing/Input-form.blade.php
Normal file
@ -0,0 +1,93 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Tambah Billing Baru')
|
||||
|
||||
@section('content')
|
||||
<div class="container px-6 mx-auto">
|
||||
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Tambah Billing Baru
|
||||
</h2>
|
||||
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<form action="{{ route('billing.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<!-- ID Registrasi -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">ID Registrasi</span>
|
||||
<select name="IdRegistrasi" id="IdRegistrasi"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
|
||||
focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
|
||||
dark:text-gray-300 dark:focus:shadow-outline-gray form-input @error('IdRegistrasi') border-red-500 @enderror"
|
||||
required>
|
||||
<option value="">Pilih ID Registrasi</option>
|
||||
@foreach ($registrasis as $registrasi)
|
||||
<option value="{{ $registrasi->IdRegistrasi }}"
|
||||
{{ old('IdRegistrasi') == $registrasi->IdRegistrasi ? 'selected' : '' }}>
|
||||
{{ $registrasi->IdRegistrasi }} - {{ $registrasi->pasien->NamaPasien ?? 'Unknown' }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('IdRegistrasi')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Tanggal Billing -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Tanggal Billing</span>
|
||||
<input type="date" name="TanggalBilling" id="TanggalBilling"
|
||||
value="{{ old('TanggalBilling', date('Y-m-d')) }}"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
|
||||
focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
|
||||
dark:text-gray-300 dark:focus:shadow-outline-gray form-input @error('TanggalBilling') border-red-500 @enderror"
|
||||
required>
|
||||
@error('TanggalBilling')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Pembayaran Awal -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Pembayaran Awal (Rp)</span>
|
||||
<input type="number" name="Dibayar" id="Dibayar" min="0" value="{{ old('Dibayar', 0) }}"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
|
||||
focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
|
||||
dark:text-gray-300 dark:focus:shadow-outline-gray form-input @error('Dibayar') border-red-500 @enderror"
|
||||
required>
|
||||
@error('Dibayar')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Keterangan -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Keterangan</span>
|
||||
<textarea name="Keterangan" id="Keterangan" rows="3"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
|
||||
focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
|
||||
dark:text-gray-300 dark:focus:shadow-outline-gray form-input @error('Keterangan') border-red-500 @enderror">{{ old('Keterangan') }}</textarea>
|
||||
@error('Keterangan')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="flex justify-start mt-6 space-x-4">
|
||||
<a href="{{ route('billing.index') }}"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150
|
||||
bg-white border border-gray-300 rounded-md dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600
|
||||
hover:border-gray-500 focus:outline-none focus:shadow-outline-gray">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150
|
||||
bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700
|
||||
focus:outline-none focus:shadow-outline-purple">
|
||||
Simpan Billing
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
101
resources/views/admin/billing/edit-form.blade.php
Normal file
@ -0,0 +1,101 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Billing')
|
||||
|
||||
@section('content')
|
||||
<div class="container px-6 mx-auto">
|
||||
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Edit Billing #{{ $billing->IdBilling }}
|
||||
</h2>
|
||||
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<form action="{{ route('billing.update', $billing->IdBilling) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- ID Registrasi -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">ID Registrasi</span>
|
||||
<input type="text"
|
||||
value="{{ $billing->registrasi->IdRegistrasi }} - {{ $billing->registrasi->pasien->NamaPasien ?? 'Unknown' }}"
|
||||
class="block w-full mt-1 text-sm bg-gray-100 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input"
|
||||
disabled>
|
||||
<span class="text-gray-500 text-xs mt-1">ID Registrasi tidak dapat diubah.</span>
|
||||
</label>
|
||||
|
||||
<!-- Tanggal Billing -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Tanggal Billing</span>
|
||||
<input type="date" name="TanggalBilling" id="TanggalBilling"
|
||||
value="{{ old('TanggalBilling', date('Y-m-d', strtotime($billing->TanggalBilling))) }}"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input @error('TanggalBilling') border-red-500 @enderror"
|
||||
required>
|
||||
@error('TanggalBilling')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Total Biaya -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Total Biaya (Rp)</span>
|
||||
<input type="text" value="Rp {{ number_format($billing->TotalBiaya, 0, ',', '.') }}"
|
||||
class="block w-full mt-1 text-sm bg-gray-100 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input"
|
||||
disabled>
|
||||
<span class="text-gray-500 text-xs mt-1">Total biaya dihitung otomatis berdasarkan transaksi.</span>
|
||||
</label>
|
||||
|
||||
<!-- Pembayaran -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Jumlah Pembayaran (Rp)</span>
|
||||
<input type="number" name="Dibayar" id="Dibayar" min="0"
|
||||
value="{{ old('Dibayar', $billing->Dibayar) }}"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input @error('Dibayar') border-red-500 @enderror"
|
||||
required>
|
||||
@error('Dibayar')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Sisa -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Sisa Pembayaran (Rp)</span>
|
||||
<input type="text" value="Rp {{ number_format($billing->Sisa, 0, ',', '.') }}"
|
||||
class="block w-full mt-1 text-sm bg-gray-100 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input"
|
||||
disabled>
|
||||
<span class="text-gray-500 text-xs mt-1">Sisa pembayaran dihitung otomatis.</span>
|
||||
</label>
|
||||
|
||||
<!-- Status Pembayaran -->
|
||||
<label class="block text-sm mb-4">
|
||||
<span class="text-gray-700 dark:text-gray-400">Status Pembayaran</span>
|
||||
<input type="text" value="{{ $billing->StatusPembayaran }}"
|
||||
class="block w-full mt-1 text-sm bg-gray-100 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input"
|
||||
disabled>
|
||||
<span class="text-gray-500 text-xs mt-1">Status pembayaran diupdate otomatis.</span>
|
||||
</label>
|
||||
|
||||
<!-- Keterangan -->
|
||||
<label class="block text-sm mb-6">
|
||||
<span class="text-gray-700 dark:text-gray-400">Keterangan</span>
|
||||
<textarea name="Keterangan" id="Keterangan" rows="3"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 form-input @error('Keterangan') border-red-500 @enderror">{{ old('Keterangan', $billing->Keterangan) }}</textarea>
|
||||
@error('Keterangan')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="flex justify-start mt-6 space-x-4">
|
||||
<a href="{{ route('billing.show', $billing->IdBilling) }}"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150 bg-white border border-gray-300 rounded-md dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600 hover:border-gray-500 focus:outline-none focus:shadow-outline-gray">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
|
||||
Simpan Perubahan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
143
resources/views/admin/billing/index.blade.php
Normal file
@ -0,0 +1,143 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Daftar Billing')
|
||||
|
||||
@section('content')
|
||||
<div class="flex justify-center items-start mt-16">
|
||||
<div class="container max-w-6xl px-6 mx-auto">
|
||||
@include('partials.messages')
|
||||
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
Daftar Billing
|
||||
</h2>
|
||||
<a href="{{ route('billing.create') }}"
|
||||
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
|
||||
<div class="flex items-center">
|
||||
<svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd"
|
||||
d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
<span>Tambah Billing Baru</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="w-full overflow-hidden rounded-lg shadow-xs">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<table class="w-full whitespace-no-wrap">
|
||||
<thead>
|
||||
<tr
|
||||
class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800">
|
||||
<th class="px-4 py-3">ID Billing</th>
|
||||
<th class="px-4 py-3">ID Registrasi</th>
|
||||
<th class="px-4 py-3">Tanggal</th>
|
||||
<th class="px-4 py-3">Total Biaya</th>
|
||||
<th class="px-4 py-3">Dibayar</th>
|
||||
<th class="px-4 py-3">Sisa</th>
|
||||
<th class="px-4 py-3">Status</th>
|
||||
<th class="px-4 py-3">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
|
||||
@forelse($billings as $billing)
|
||||
<tr class="text-gray-700 dark:text-gray-400">
|
||||
<td class="px-4 py-3 text-sm">{{ $billing->IdBilling }}</td>
|
||||
<td class="px-4 py-3 text-sm">{{ $billing->IdRegistrasi }}</td>
|
||||
<td class="px-4 py-3 text-sm">{{ date('d/m/Y', strtotime($billing->TanggalBilling)) }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm">Rp {{ number_format($billing->TotalBiaya, 0, ',', '.') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm">Rp {{ number_format($billing->Dibayar, 0, ',', '.') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm">Rp {{ number_format($billing->Sisa, 0, ',', '.') }}</td>
|
||||
<td class="px-4 py-3 text-sm">
|
||||
@if ($billing->StatusPembayaran == 'Lunas')
|
||||
<span
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
|
||||
Lunas
|
||||
</span>
|
||||
@else
|
||||
<span
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">
|
||||
Belum Lunas
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm">
|
||||
<div class="flex items-center space-x-4 text-sm">
|
||||
<a href="{{ route('billing.show', $billing->IdBilling) }}"
|
||||
class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-purple-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray"
|
||||
aria-label="Detail">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M1 10s3-7 9-7 9 7 9 7-3 7-9 7-9-7-9-7z" />
|
||||
<path d="M10 13a3 3 0 100-6 3 3 0 000 6z" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="{{ route('billing.edit', $billing->IdBilling) }}"
|
||||
class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-purple-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray"
|
||||
aria-label="Edit">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" />
|
||||
</svg>
|
||||
</a>
|
||||
<form id="delete-form-{{ $billing->IdBilling }}"
|
||||
action="{{ route('billing.destroy', $billing->IdBilling) }}" method="POST"
|
||||
class="inline-block">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="button" onclick="confirmDelete('{{ $billing->IdBilling }}')"
|
||||
class="flex items-center justify-between px-2 py-2 text-sm font-medium leading-5 text-purple-600 rounded-lg dark:text-gray-400 focus:outline-none focus:shadow-outline-gray"
|
||||
aria-label="Delete">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd"
|
||||
d="M6 2a1 1 0 00-.894.553L4.618 4H3a1 1 0 000 2h1v10a2 2 0 002 2h8a2 2 0 002-2V6h1a1 1 0 100-2h-1.618l-.488-1.447A1 1 0 0014 2H6zm2 4a1 1 0 112 0v8a1 1 0 11-2 0V6zm4 0a1 1 0 112 0v8a1 1 0 11-2 0V6z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-3 text-center text-gray-500">
|
||||
Tidak ada data billing
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
<div class="px-4 py-3 border-t dark:border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-500">
|
||||
{{ $billings->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
const confirmDelete = (IdBilling) => {
|
||||
Swal.fire({
|
||||
title: "Hapus billing?",
|
||||
text: "Billing yang dihapus tidak bisa dikembalikan. Yakin ingin lanjut?",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Ya, hapus!",
|
||||
cancelButtonText: "Batal"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
document.getElementById(`delete-form-${IdBilling}`).submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
171
resources/views/admin/billing/show-form.blade.php
Normal file
@ -0,0 +1,171 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Detail Billing')
|
||||
|
||||
@section('content')
|
||||
<div class="container px-6 mx-auto grid">
|
||||
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Detail Billing #{{ $billing->IdBilling }}
|
||||
</h2>
|
||||
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<!-- Header -->
|
||||
<div class="flex justify-between items-center pb-4 border-b dark:border-gray-700">
|
||||
<h4 class="text-lg font-semibold text-gray-600 dark:text-gray-300">
|
||||
Informasi Billing
|
||||
</h4>
|
||||
<div class="flex space-x-2">
|
||||
<a href="{{ route('billing.edit', $billing->IdBilling) }}"
|
||||
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-yellow-500 border border-transparent rounded-lg active:bg-yellow-600 hover:bg-yellow-600 focus:outline-none focus:shadow-outline-yellow">
|
||||
Edit
|
||||
</a>
|
||||
<a href="{{ route('billing.index') }}"
|
||||
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-gray-600 border border-transparent rounded-lg active:bg-gray-600 hover:bg-gray-700 focus:outline-none focus:shadow-outline-gray">
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Billing Information -->
|
||||
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div class="p-4 bg-gray-50 rounded-lg dark:bg-gray-700">
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">ID Billing</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
{{ $billing->IdBilling }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">ID Registrasi</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
{{ $billing->IdRegistrasi }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Tanggal Billing</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
{{ date('d/m/Y', strtotime($billing->TanggalBilling)) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Status Pembayaran</span>
|
||||
<div class="mt-2">
|
||||
@if ($billing->StatusPembayaran == 'Lunas')
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||||
Lunas
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
||||
Belum Lunas
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Keterangan</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
{{ $billing->Keterangan ?: '-' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 bg-gray-50 rounded-lg dark:bg-gray-700">
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Biaya</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
Rp {{ number_format($billing->TotalBiaya, 0, ',', '.') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Sudah Dibayar</span>
|
||||
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
Rp {{ number_format($billing->Dibayar, 0, ',', '.') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Sisa Pembayaran</span>
|
||||
<div
|
||||
class="mt-2 text-lg font-semibold text-{{ $billing->Sisa > 0 ? 'red' : 'green' }}-600 dark:text-{{ $billing->Sisa > 0 ? 'red' : 'green' }}-500">
|
||||
Rp {{ number_format($billing->Sisa, 0, ',', '.') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Additional Payment Form for unpaid billings -->
|
||||
@if ($billing->StatusPembayaran == 'Belum Lunas')
|
||||
<div class="mt-4 bg-blue-50 p-4 rounded-lg border border-blue-200 dark:bg-blue-700 dark:border-blue-800">
|
||||
<h3 class="text-lg font-semibold mb-3 text-blue-700 dark:text-blue-300">Tambah Pembayaran</h3>
|
||||
|
||||
<form action="{{ route('billing.processPayment', $billing->IdBilling) }}" method="POST">
|
||||
@csrf
|
||||
<div class="flex items-end space-x-4">
|
||||
<div class="flex-grow">
|
||||
<label for="jumlah_bayar"
|
||||
class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-1">Jumlah
|
||||
Pembayaran (Rp)</label>
|
||||
<input type="number" name="jumlah_bayar" id="jumlah_bayar" min="1"
|
||||
max="{{ $billing->Sisa }}" value="{{ old('jumlah_bayar', $billing->Sisa) }}"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-200"
|
||||
required>
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-blue-700 dark:hover:bg-blue-800">
|
||||
Proses Pembayaran
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Transaksi Details -->
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-semibold mb-3 text-gray-700 dark:text-gray-300">Detail Transaksi</h3>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-700">
|
||||
<thead>
|
||||
<tr class="bg-gray-100 dark:bg-gray-700">
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
ID Transaksi</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Tindakan</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Tarif</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Jumlah</th>
|
||||
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Subtotal</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 dark:divide-gray-600">
|
||||
@forelse($transaksis as $transaksi)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
||||
{{ $transaksi->IdTransaksi }}</td>
|
||||
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
||||
{{ $transaksi->tindakan->NamaTindakan ?? 'Unknown' }}</td>
|
||||
<td class="px-4 py-3 text-sm text-gray-500 dark:text-gray-300">
|
||||
Rp {{ number_format($transaksi->tindakan->TarifTindakan ?? 0, 0, ',', '.') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-sm text-gray-500 dark:text-gray-300">
|
||||
{{ $transaksi->JmlTindakan }}</td>
|
||||
<td class="px-4 py-3 text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
Rp
|
||||
{{ number_format(($transaksi->tindakan->TarifTindakan ?? 0) * $transaksi->JmlTindakan, 0, ',', '.') }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5"
|
||||
class="px-4 py-3 text-sm text-center text-gray-500 dark:text-gray-400">Tidak ada
|
||||
data transaksi.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
38
resources/views/admin/master/MsAsuransi/Input-form.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container px-6 mx-auto">
|
||||
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Form Data Asuransi
|
||||
</h2>
|
||||
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<form action="{{ route('master-asuransi.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<!-- Nama Asuransi -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Nama Asuransi</span>
|
||||
<input type="text" name="NamaAsuransi"
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
|
||||
placeholder="Masukkan Nama Asuransi" required />
|
||||
@error('NamaAsuransi')
|
||||
<span class="text-xs text-red-600 dark:text-red-400">{{ $message }}</span>
|
||||
@enderror
|
||||
</label>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="flex justify-start mt-6 space-x-4">
|
||||
<a href="{{ route('master-asuransi.index') }}"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150 bg-white border border-gray-300 rounded-md dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600 hover:border-gray-500 focus:outline-none focus:shadow-outline-gray">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="px-6 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
|
||||
Simpan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||