first commit

This commit is contained in:
Fandodevi 2024-06-25 15:27:26 +07:00
commit e5adffaed2
495 changed files with 108476 additions and 0 deletions

18
.editorconfig Normal file
View 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

59
.env.example Normal file
View File

@ -0,0 +1,59 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=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
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

11
.gitattributes vendored Normal file
View 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

19
.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode

4
.htaccess Normal file
View File

@ -0,0 +1,4 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/$ public/$1 [L]
</IfModule>

66
README.md Normal file
View File

@ -0,0 +1,66 @@
<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 over 2000 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)**
- **[WebReinvent](https://webreinvent.com/)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Jump24](https://jump24.co.uk)**
- **[Redberry](https://redberry.international/laravel/)**
- **[Active Logic](https://activelogic.com)**
- **[byte5](https://byte5.de)**
- **[OP.GG](https://op.gg)**
## 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).

View File

@ -0,0 +1,45 @@
<?php
namespace App\Charts;
use App\Models\Anggota;
use ArielMejiaDev\LarapexCharts\LineChart;
use Carbon\Carbon;
class AnggotaChart
{
protected $chart;
public function __construct(LineChart $chart)
{
$this->chart = $chart;
}
public function build($tahun = null): LineChart
{
$tahun = $tahun ?: date('Y');
$bulan = 12;
$dataAnggota = [];
$dataBulan = [];
for ($i = 1; $i <= $bulan; $i++) {
$jumlahAnggota = Anggota::whereYear('created_at', $tahun)
->whereMonth('created_at', $i)
->count();
$dataBulan[] = Carbon::create()->month($i)->format('F');
$dataAnggota[] = $jumlahAnggota;
}
$totalAnggotaBulanIni = array_sum($dataAnggota);
$subtitle = 'Total Anggota Baru Tahun ' . $tahun . ': ' . $totalAnggotaBulanIni;
$this->chart->setTitle('Pertumbuhan Anggota')
->setSubtitle($subtitle)
->addData('Jumlah Anggota', $dataAnggota)
->setXAxis($dataBulan);
return $this->chart;
}
}

View File

@ -0,0 +1,42 @@
<?php
namespace App\Charts;
use App\Models\Anggota;
use ArielMejiaDev\LarapexCharts\PieChart;
use Illuminate\Support\Facades\DB;
class JenisAnggotaChart
{
protected $chart;
public function __construct(PieChart $chart)
{
$this->chart = $chart;
}
public function build($tahun = null): PieChart
{
$tahun = $tahun ?: date('Y');
$data = Anggota::select('jenis_anggota', DB::raw('count(*) as total'))
->whereYear('created_at', $tahun)
->groupBy('jenis_anggota')
->pluck('total', 'jenis_anggota')->toArray();
$anggotaPendiri = Anggota::where('jenis_anggota', 'Pendiri')
->whereYear('created_at', $tahun)
->count();
$anggotaBiasa = Anggota::where('jenis_anggota', 'Biasa')
->whereYear('created_at', $tahun)
->count();
$this->chart->setTitle('Distribusi Jenis Anggota')
->setSubtitle('Total Anggota Pendiri = ' . $anggotaPendiri . ', ' . 'Total Anggota Biasa = ' . $anggotaBiasa)
->addData([$anggotaPendiri, $anggotaBiasa])
->setLabels(['Anggota Pendiri', 'Anggota Biasa'])
->setColors(['#36A2EB', '#FF6384']);
return $this->chart;
}
}

62
app/Charts/SHUChart.php Normal file
View File

@ -0,0 +1,62 @@
<?php
namespace App\Charts;
use App\Models\Laporan;
use ArielMejiaDev\LarapexCharts\LineChart;
use Carbon\Carbon;
class SHUChart
{
protected $chart;
public function __construct(LineChart $chart)
{
$this->chart = $chart;
}
public function build($tahun = null): LineChart
{
$tahun = $tahun ?: date('Y');
$bulan = date('m');
$dataPendapatanBunga = [];
$dataBebanOperasional = [];
$dataBulan = [];
$sisa_hasil_usaha = [];
for ($i = 1; $i <= 12; $i++) {
if ($tahun == date('Y') && $i > $bulan) {
break;
}
$laporan = Laporan::with('detail_pinjaman')
->whereYear('created_at', $tahun)
->whereMonth('created_at', $i)
->get();
$pendapatan_bunga = $laporan->where('keterangan', 'Pendapatan Bunga');
$total_pendapatan_bunga = $pendapatan_bunga->sum('jumlah_uang');
$beban_operasional = $laporan->where('klasifikasi', 'Beban Operasional');
$total_beban_operasional = $beban_operasional->sum('jumlah_uang');
$dataPendapatanBunga[] = $total_pendapatan_bunga;
$dataBebanOperasional[] = $total_beban_operasional;
$dataBulan[] = Carbon::create()->month($i)->format('F');
$sisa_hasil_usaha[] = $total_pendapatan_bunga - $total_beban_operasional;
}
$lastIndex = count($sisa_hasil_usaha) - 1;
$subtitle = $lastIndex >= 0 ? 'Total Sisa Hasil Usaha Sekarang Rp ' . number_format($sisa_hasil_usaha[$lastIndex], 2, ',', '.') : '';
$this->chart->setTitle('Sisa Hasil Usaha')
->setSubtitle($subtitle)
->addData('SHU', $sisa_hasil_usaha)
->addData('Pendapatan Bunga', $dataPendapatanBunga)
->addData('Beban Operasional', $dataBebanOperasional)
->setXAxis($dataBulan);
return $this->chart;
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace App\Charts;
use App\Models\DetailPinjaman;
use App\Models\DetailSimpanan;
use App\Models\HistoryTransaksi;
use App\Models\Pinjaman;
use ArielMejiaDev\LarapexCharts\PieChart;
use Carbon\Carbon;
class TransaksiChart
{
protected $chart;
public function __construct(PieChart $chart)
{
$this->chart = $chart;
}
public function build($tahun = null): PieChart
{
$tahun = $tahun ?: date('Y');
$totalPemasukan = 0.00;
$totalPengeluaran = 0.00;
$rekap = HistoryTransaksi::with('users', 'anggota', 'detail_simpanan', 'pinjaman', 'detail_pinjaman')
->whereYear('created_at', $tahun)
->get();
foreach ($rekap as $item) {
if ($item->id_detail_simpanan != null) {
$detail_simpanan = DetailSimpanan::find($item->id_detail_simpanan);
$simpanan_pokok = $detail_simpanan->simpanan_pokok;
$simpanan_wajib = $detail_simpanan->simpanan_wajib;
$simpanan_sukarela = $detail_simpanan->simpanan_sukarela;
if ($item->tipe_transaksi == 'Pemasukan') {
$totalPemasukan += $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
} else {
$totalPengeluaran += $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
}
} elseif ($item->id_pinjaman != null) {
$pinjaman = Pinjaman::find($item->id_pinjaman);
$totalPengeluaran += $pinjaman->total_pinjaman;
} else {
$detail_pinjaman = DetailPinjaman::find($item->id_detail_pinjaman);
$totalPemasukan += $detail_pinjaman->angsuran_pokok;
}
}
$this->chart->setTitle('Pemasukan & Pengeluaran')
->setSubtitle('Total Pendapatan Koperasi Sekarang Rp ' . number_format($totalPemasukan - $totalPengeluaran, 2, ',', '.'))
->addData([$totalPemasukan, $totalPengeluaran])
->setLabels(['Pemasukan', 'Pengeluaran'])
->setColors(['#36A2EB', '#FF6384']);
return $this->chart;
}
}

27
app/Console/Kernel.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}

7
app/Helpers/Helper.php Normal file
View File

@ -0,0 +1,7 @@
<?php
function set_active($route){
if (Route::is($route)){
return 'active';
}
}

View File

@ -0,0 +1,197 @@
<?php
namespace App\Http\Controllers;
use App\Exports\ExportAnggota;
use App\Models\anggota;
use App\Models\User;
use Carbon\Carbon;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
use Maatwebsite\Excel\Facades\Excel;
use Yajra\DataTables\DataTables;
class AnggotaController extends Controller
{
public function index(Request $request)
{
$users = Anggota::orderBy('created_at', 'desc')->get();
if ($request->ajax()) {
return DataTables::of($users)
->addColumn('DT_RowIndex', function ($user) {
return $user->id_anggota;
})
->toJson();
}
return view('pages.anggota.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('pages.anggota.create');
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16|unique:users',
'nama' => 'required',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'noTelp' => 'required|numeric',
'pekerjaan' => 'required',
'jenisanggota' => 'required|in:Pendiri,Biasa',
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$anggota = new Anggota();
$anggota->nik = $request->nik;
$anggota->no_anggota = $this->generateMemberNumber();
$anggota->nama = $request->nama;
$anggota->jenis_kelamin = $request->jeniskelamin;
$anggota->alamat = $request->alamat;
$anggota->no_telp = $request->noTelp;
$anggota->pekerjaan = $request->pekerjaan;
$anggota->jenis_anggota = $request->jenisanggota;
if ($anggota->save()) {
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.anggota')->with('success', 'Data anggota berhasil disimpan.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('anggota')->with('success', 'Data anggota berhasil disimpan.');
} else {
return redirect()->route('pegawai.anggota')->with('success', 'Data anggota berhasil disimpan.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
$users = anggota::find($id);
return view('pages.anggota.edit', ['users' => $users]);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
$anggota = anggota::find($id);
if (!$anggota) {
return back()->withErrors(['error' => 'Anggota tidak ditemukan. Silahkan coba kembali']);
}
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16',
'nama' => 'required',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'noTelp' => 'required|numeric',
'pekerjaan' => 'required',
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$anggota->nik = $request->nik;
$anggota->nama = $request->nama;
$anggota->jenis_kelamin = $request->jeniskelamin;
$anggota->alamat = $request->alamat;
$anggota->no_telp = $request->noTelp;
$anggota->pekerjaan = $request->pekerjaan;
if ($anggota->save()) {
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.anggota')->with('success', 'Data Anggota berhasil diperbarui.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('anggota')->with('success', 'Data Anggota berhasil diperbarui.');
} else {
return redirect()->route('pegawai.anggota')->with('success', 'Data Anggota berhasil diperbarui.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$users = anggota::where('id_anggota', $id)->first();
if ($users) {
$users->delete();
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.anggota')->with('success', 'Data anggota berhasil dihapus.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('anggota')->with('success', 'Data anggota berhasil dihapus.');
} else {
return redirect()->route('pegawai.anggota')->with('success', 'Data anggota berhasil dihapus.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
public function export()
{
$data = anggota::count();
if ($data != 0) {
$anggota = anggota::all();
$tahun = Carbon::now()->format('Y');
$html = view('pages.report.anggota', compact('anggota', 'tahun'))->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream('Anggota Koperasi.pdf');
} else {
return back()->withErrors(['error' => 'Data Anggota masih kosong. Silahkan coba kembali.']);
}
}
private function generateMemberNumber()
{
$currentDate = now();
$dateString = $currentDate->format('dmY');
$randomNumber = '';
for ($i = 0; $i < 6; $i++) {
$randomNumber .= mt_rand(0, 9);
}
$memberNumber = $dateString . $randomNumber;
return $memberNumber;
}
}

View File

@ -0,0 +1,101 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AuthController extends Controller
{
/**
* Display a listing of the resource.
*/
public function login()
{
return view('auth.login');
}
public function authenticate(Request $request): RedirectResponse
{
$credentials = $request->validate([
'username' => ['required'],
'password' => ['required'],
], [
'username.required' => 'Username harus diisi.',
'password.required' => 'Kata sandi harus diisi.',
]);
$registeredUser = User::where('username', $request->username)->first();
if ($registeredUser) {
if (Auth::attempt($credentials)) {
$request->session()->regenerate();
if (Auth::user()->id_role == '1') {
return redirect('admin/dashboard');
} elseif (Auth::user()->id_role == '2') {
return redirect('pengurus/dashboard');
} else {
return redirect('dashboard');
}
} else {
return back()->withInput()->withErrors('Username dan Password yang dimasukkan tidak sesuai');
}
}
return back()->withInput()->withErrors('Akun tidak ditemukan');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Request $request)
{
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/');
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
}

View File

@ -0,0 +1,239 @@
<?php
namespace App\Http\Controllers;
use App\Charts\AnggotaChart;
use App\Charts\JenisAnggotaChart;
use App\Charts\SHUChart;
use App\Charts\TransaksiChart;
use App\Models\Anggota;
use App\Models\DetailPinjaman;
use App\Models\DetailSimpanan;
use App\Models\HistoryTransaksi;
use App\Models\Laporan;
use App\Models\Pinjaman;
use App\Models\Simpanan;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Yajra\DataTables\DataTables;
class DashboardController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(SHUChart $lineChart, TransaksiChart $pieChart, AnggotaChart $lineChartAnggota, JenisAnggotaChart $pieChartJenisAnggota, Request $request)
{
$jumlahAnggota = Anggota::count();
$jumlahPegawai = User::where('id_role', '!=', '1')->count();
$jumlahSimpanan = Simpanan::count();
$jumlahPinjaman = Pinjaman::count();
$jumlahAnggotaBulanLalu = Anggota::whereMonth('created_at', '=', Carbon::now()->subMonth()->month)->count();
$pertumbuhanAnggota = 0;
if ($jumlahAnggotaBulanLalu > 0) {
$pertumbuhanAnggota = (($jumlahAnggota - $jumlahAnggotaBulanLalu) / $jumlahAnggota) * 100;
} else {
$pertumbuhanAnggota = 100;
}
$selectedYear = $request->get('tahun');
if (Auth::user()->id_role == 1) {
$anggotaTahun = Anggota::selectRaw('YEAR(created_at) as year')
->distinct()
->pluck('year')
->sortDesc()
->toArray();
if ($selectedYear) {
$anggotaData = Anggota::whereYear('created_at', $selectedYear)->get();
$jenisData = Anggota::whereYear('created_at', $selectedYear)->get();
} else {
$anggotaData = Anggota::all();
$jenisaData = Anggota::all();
}
$anggotaChart = $lineChartAnggota->build($selectedYear);
$jenisAnggotaChart = $pieChartJenisAnggota->build($selectedYear);
return view('pages.dashboard.index', compact('jumlahAnggota', 'jumlahPegawai', 'jumlahSimpanan', 'jumlahPinjaman', 'anggotaChart', 'jenisAnggotaChart', 'pertumbuhanAnggota', 'anggotaTahun', 'selectedYear'));
} else {
$setor = DetailSimpanan::where('jenis_transaksi', '=', 'Setor')
->get();
$tarik = DetailSimpanan::where('jenis_transaksi', '=', 'Tarik')
->get();
$shuTahun = Laporan::selectRaw('YEAR(created_at) as year')
->distinct()
->pluck('year')
->sortDesc()
->toArray();
$transaksiTahun = HistoryTransaksi::selectRaw('YEAR(created_at) as year')
->distinct()
->pluck('year')
->sortDesc()
->toArray();
$totalSimpananPokok = $setor->sum('simpanan_pokok');
$totalSimpananWajib = $setor->sum('simpanan_wajib');
$totalSimpananSukarela = $setor->sum('simpanan_sukarela');
$totalPenarikanPokok = $tarik->sum('simpanan_pokok');
$totalPenarikanWajib = $tarik->sum('simpanan_wajib');
$totalPenarikanSukarela = $tarik->sum('simpanan_sukarela');
$totalSimpananPokok -= $totalPenarikanPokok;
$totalSimpananWajib -= $totalPenarikanWajib;
$totalSimpananSukarela -= $totalPenarikanSukarela;
$rekap = HistoryTransaksi::with('users', 'anggota', 'detail_simpanan', 'pinjaman', 'detail_pinjaman')->orderBy('created_at', 'desc')->get();
$shuChart = $lineChart->build($selectedYear);
$transaksiChart = $pieChart->build($selectedYear);
$jumlahMasuk = 0.00;
$jumlahKeluar = 0.00;
$totalPemasukan = 0.00;
$totalPengeluaran = 0.00;
foreach ($rekap as $item) {
if ($item->id_detail_simpanan != null) {
$detail_simpanan = DetailSimpanan::find($item->id_detail_simpanan);
$simpanan_pokok = $detail_simpanan->simpanan_pokok;
$simpanan_wajib = $detail_simpanan->simpanan_wajib;
$simpanan_sukarela = $detail_simpanan->simpanan_sukarela;
if ($item->tipe_transaksi == 'Pemasukan') {
$jenis_transaksi = 'Setor Simpanan';
$jumlahMasuk = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPemasukan += $jumlahMasuk;
} else {
$jenis_transaksi = 'Tarik Simpanan';
$jumlahKeluar = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPengeluaran += $jumlahKeluar;
}
} elseif ($item->id_pinjaman != null) {
$pinjaman = Pinjaman::find($item->id_pinjaman);
$jumlahKeluar = $pinjaman->total_pinjaman;
$totalPengeluaran += $jumlahKeluar;
$jenis_transaksi = 'Pengajuan Pinjaman';
} else {
$detail_pinjaman = DetailPinjaman::find($item->id_detail_pinjaman);
$jumlahMasuk = $detail_pinjaman->angsuran_pokok;
$totalPemasukan += $jumlahMasuk;
$jenis_transaksi = 'Angsuran Pinjaman';
}
}
$pendapatan = $totalPemasukan - $totalPengeluaran;
$cek_detail_pinjaman = DetailPinjaman::where('status_pelunasan', 'Belum Lunas')->with(['pinjaman', 'users'])->get();
foreach ($cek_detail_pinjaman as $row) {
if ($row->status_pelunasan == 'Belum Lunas') {
if ($row->tanggal_jatuh_tempo < Carbon::now()) {
$row->status_pelunasan = 'Lewat Jatuh Tempo';
$row->save();
}
}
if ($row->status_pelunasan == 'Lewat Jatuh Tempo') {
if ($row->tanggal_jatuh_tempo > Carbon::now()) {
$row->status_pelunasan = 'Belum Lunas';
$row->save();
}
}
}
$detail_pinjaman = DetailPinjaman::where('status_pelunasan', 'Lewat Jatuh Tempo')->with(['pinjaman', 'users'])->get();
$rowData = [];
if ($request->ajax()) {
foreach ($detail_pinjaman as $row) {
if ($row->status_pelunasan == 'Belum Lunas') {
if ($row->tanggal_jatuh_tempo < Carbon::now()) {
$row->status_pelunasan = 'Lewat Jatuh Tempo';
$row->save();
}
}
if ($row->status_pelunasan == 'Lewat Jatuh Tempo') {
if ($row->tanggal_jatuh_tempo > Carbon::now()) {
$row->status_pelunasan = 'Belum Lunas';
$row->save();
}
}
$pinjaman = $row->pinjaman;
$pinjaman = Pinjaman::where('id_pinjaman', $pinjaman->id_pinjaman)->with('anggota')->first();
$rowData[] = [
'DT_RowIndex' => $row->id_pinjaman,
'id_pinjaman' => $pinjaman->id_pinjaman,
'nama_anggota' => $pinjaman->anggota->nama,
'tanggal_jatuh_tempo' => $row->tanggal_jatuh_tempo,
'angsuran_ke_' => $row->angsuran_ke_,
'angsuran_pokok' => $row->angsuran_pokok,
'bunga' => $row->bunga,
'subtotal_angsuran' => $row->subtotal_angsuran,
'status_pelunasan' => $row->status_pelunasan
];
}
return DataTables::of($rowData)->toJson();
}
return view('pages.dashboard.index', compact('jumlahAnggota', 'jumlahPegawai', 'jumlahSimpanan', 'jumlahPinjaman', 'totalSimpananPokok', 'totalSimpananWajib', 'totalSimpananSukarela', 'pendapatan', 'shuChart', 'transaksiChart', 'pertumbuhanAnggota', 'shuTahun', 'transaksiTahun', 'selectedYear'));
}
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function dashboard(){
// $jumlah_cust = Customer::count();
// $jumlah_aset = Product::count();
// $jumlah_transaksi = Order::count();
// return view('dashboard' , compact('jumlah_cust', 'jumlah_aset', 'jumlah_transaksi'));
return view('dashboard');
}
}

View File

@ -0,0 +1,172 @@
<?php
namespace App\Http\Controllers;
use App\Models\Laporan;
use Carbon\Carbon;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Yajra\DataTables\DataTables;
class LaporanController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
$data = Laporan::with('detail_pinjaman')->latest('created_at')->get();
if ($request->ajax()) {
return DataTables::of($data)
->addColumn('DT_RowIndex', function ($data) {
return $data->id;
})
->addColumn('created_at', function ($data) {
return $data->created_at->format('d-m-Y h:i:s');
})
->toJson();
}
return view('pages.laporan.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'jumlah_uang' => 'required|numeric|regex:/^\d+(\.\d{1,2})?$/|min:0',
'keterangan' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$laporan = new Laporan();
$laporan->keterangan = $request->keterangan;
$laporan->klasifikasi = 'Beban Operasional';
$laporan->jumlah_uang = $request->jumlah_uang;
if ($laporan->save()) {
return back()->with(['success' => 'Data Laporan berhasil ditambahkan.']);
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
$validator = Validator::make($request->all(), [
'jumlah_uang' => 'required|numeric|regex:/^\d+(\.\d{1,2})?$/|min:0',
'keterangan' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$laporan = Laporan::find($request->id_laporan);
if (!$laporan) {
return back()->withErrors(['error' => 'Data laporan tidak ditemukan']);
}
if ($laporan->keterangan == 'Pendapatan Bunga') {
return back()->withErrors(['error' => 'Data laporan pendapatan bunga tidak dapat di edit']);
} else {
$laporan->keterangan = $request->keterangan;
$laporan->jumlah_uang = $request->jumlah_uang;
if ($laporan->save()) {
return back()->with(['success' => 'Data Laporan berhasil diperbarui.']);
} else {
return back()->withErrors(['error' => 'Terjadi kesalahan saat menambahkan data']);
}
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$laporan = Laporan::where('id', $id)->first();
if ($laporan->keterangan == 'Pendapatan Bunga') {
return back()->withErrors(['error' => 'Pendapatan bunga tidak dapat dihapus']);
}
$laporan->delete();
return redirect()->route('laporan')->with('success', 'Data Laporan berhasil dihapus');
}
public function export(Request $request)
{
$data = Laporan::all();
if ($data) {
$startDate = Carbon::parse($request->input('start_date'))->startOfDay();
$endDate = Carbon::parse($request->input('end_date'))->endOfDay();
$laporan = Laporan::with('detail_pinjaman')->whereBetween('created_at', [$startDate, $endDate])->get();
$tahun = Carbon::now()->format('Y');
$tanggal_cetak = Carbon::now()->format('d/m/Y');
$pendapatan_bunga = $laporan->where('keterangan', 'Pendapatan Bunga');
$total_pendapatan_bunga = $pendapatan_bunga->sum('jumlah_uang');
$beban_operasional = $laporan->where('klasifikasi', 'Beban Operasional');
$total_beban_operasional = $beban_operasional->sum('jumlah_uang');
$sisa_hasil_usaha = $total_pendapatan_bunga - $total_beban_operasional;
$html = view('pages.report.laporan', compact('beban_operasional', 'tahun', 'tanggal_cetak', 'total_pendapatan_bunga', 'total_beban_operasional', 'sisa_hasil_usaha'))->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('Laporan_Laba_Rugi.pdf');
} else {
return back()->withErrors(['error' => 'Data Laporan SHU masih kosong. Silahkan coba kembali.']);
}
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
// use Illuminate\Support\Auth;
class LoginController extends Controller
{
public function index()
{
return view('auth.login');
}
public function login(Request $request)
{
$request->validate([
'emailzz' => 'required',
'password' => 'required'
], [
'email.required' => 'Email wajib diisi',
'password.required' => 'Password wajib diisi',
]);
$infologin = [
'email' => $request->email,
'password' => $request->password,
];
if (Auth::attempt($infologin)) {
return redirect('dashboard');
} else {
return redirect('')->withErrors('Email dan Password yang dimasukkan tidak sesuai')->withInput();
}
}
public function logout()
{
Auth::logout();
return redirect()->route('login');
}
}

View File

@ -0,0 +1,229 @@
<?php
namespace App\Http\Controllers;
use App\Exports\ExportPegawai;
use App\Models\Anggota;
use App\Models\User;
use Carbon\Carbon;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
// use Maatwebsite\Excel\Excel;
use Maatwebsite\Excel\Facades\Excel;
use Yajra\DataTables\DataTables;
class PegawaiController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
$users = User::where('id_role', '!=', 1)->with('role')->orderBy('created_at', 'desc')->get();
if ($request->ajax()) {
return DataTables::of($users)
->addColumn('DT_RowIndex', function ($user) {
return $user->id_users;
})
->toJson();
}
return view('pages.pegawai.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('pages.pegawai.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16|unique:users',
'nama' => 'required',
'username' => 'required|unique:users',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'noTelp' => 'required|numeric',
'password' => 'required|min:8',
'role' => 'required|in:2,3',
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$pegawai = new User();
$pegawai->nik = $request->nik;
$pegawai->nama = $request->nama;
$pegawai->username = $request->username;
$pegawai->password = Hash::make($request->password);
$pegawai->jenis_kelamin = $request->jeniskelamin;
$pegawai->alamat = $request->alamat;
$pegawai->no_telp = $request->noTelp;
$pegawai->id_role = $request->role;
if ($pegawai->save()) {
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.pegawai')->with('success', 'Data pegawai berhasil disimpan.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('pegawai')->with('success', 'Data pegawai berhasil disimpan.');
} else {
return redirect()->route('pegawai.pegawai')->with('success', 'Data pegawai berhasil disimpan.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
$users = User::with('role')->find($id);
return view('pages.pegawai.edit', ['users' => $users]);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
$pegawai = User::find($id);
if (!$pegawai) {
return back()->withErrors(['error' => 'Pegawai tidak ditemukan. Silahkan coba kembali']);
}
if ($request->new_password == null) {
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16',
'nama' => 'required',
'username' => 'required|unique:users,username,' . $id . ',id_users',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'noTelp' => 'required|numeric',
'role' => 'required|in:2,3',
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$pegawai->nik = $request->nik;
$pegawai->nama = $request->nama;
$pegawai->username = $request->username;
$pegawai->jenis_kelamin = $request->jeniskelamin;
$pegawai->alamat = $request->alamat;
$pegawai->no_telp = $request->noTelp;
$pegawai->id_role = $request->role;
} else {
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16',
'nama' => 'required',
'username' => 'required|unique:users,username,' . $id . ',id_users',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'noTelp' => 'required|numeric',
'new_password' => 'required|min:8',
'role' => 'required|in:2,3',
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$pegawai->nik = $request->nik;
$pegawai->nama = $request->nama;
$pegawai->username = $request->username;
$pegawai->jenis_kelamin = $request->jeniskelamin;
$pegawai->alamat = $request->alamat;
$pegawai->no_telp = $request->noTelp;
$pegawai->id_role = $request->role;
$pegawai->password = Hash::make($request->new_password);
}
if ($pegawai->save()) {
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.pegawai')->with('success', 'Data pegawai berhasil diperbarui.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('pegawai')->with('success', 'Data pegawai berhasil diperbarui.');
} else {
return redirect()->route('pegawai.pegawai')->with('success', 'Data pegawai berhasil diperbarui.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$users = User::where('id_users', $id)->first();
if ($users) {
$users->delete();
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.pegawai')->with('success', 'Data pegawai berhasil dihapus.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('pegawai')->with('success', 'Data pegawai berhasil dihapus.');
} else {
return redirect()->route('pegawai.pegawai')->with('success', 'Data pegawai berhasil dihapus.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menghapus data'], 500);
}
}
public function export()
{
$data = User::where('id_role', '=', 3)->count();
if ($data != 0) {
$users = User::where('id_role', 3)->get();
$tahun = Carbon::now()->format('Y');
$html = view('pages.report.pegawai', compact('users', 'tahun'))->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('Pegawai Koperasi.pdf');
} else {
return back()->withErrors(['error' => 'Data Pegawai masih kosong. Silahkan coba kembali.']);
}
}
}

View File

@ -0,0 +1,488 @@
<?php
namespace App\Http\Controllers;
use App\Models\Anggota;
use App\Models\DetailPinjaman;
use App\Models\DetailSimpanan;
use App\Models\HistoryTransaksi;
use App\Models\Laporan;
use App\Models\Pinjaman;
use Carbon\Carbon;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Yajra\DataTables\DataTables;
class PinjamanController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
return view('pages.pinjaman.index');
}
public function belumLunas(Request $request)
{
$pinjaman = Pinjaman::where('status_pinjaman', 'Belum Lunas')->with('anggota')->get();
if ($request->ajax()) {
return DataTables::of($pinjaman)
->addColumn('DT_RowIndex', function ($pinjaman) {
return $pinjaman->id_pinjaman;
})
->addColumn('nama', function ($pinjaman) {
return $pinjaman->anggota->nama;
})
->addColumn('jenis_anggota', function ($pinjaman) {
return $pinjaman->anggota->jenis_anggota;
})
->toJson();
}
}
public function Lunas(Request $request)
{
$pinjaman = Pinjaman::where('status_pinjaman', 'Lunas')->with('anggota')->get();
if ($request->ajax()) {
return DataTables::of($pinjaman)
->addColumn('DT_RowIndex', function ($pinjaman) {
return $pinjaman->id_pinjaman;
})
->addColumn('nama', function ($pinjaman) {
return $pinjaman->anggota->nama;
})
->addColumn('jenis_anggota', function ($pinjaman) {
return $pinjaman->anggota->jenis_anggota;
})
->toJson();
}
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('pages.pinjaman.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'id_anggota' => 'required|exists:anggota,id_anggota',
'angsuran' => 'required|max:12|min:1',
'nominal_pinjaman' => 'required|numeric|regex:/^\d+(\.\d{1,2})?$/|max:5000000',
'bunga_pinjaman' => 'required|max:100|min:1'
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$pinjaman_belum_lunas = Pinjaman::where('id_anggota', $request->id_anggota)
->where('status_pinjaman', 'Belum Lunas')
->first();
if ($pinjaman_belum_lunas) {
return redirect()->back()->with(['error' => 'Anggota memiliki pinjaman yang belum lunas.']);
}
try {
DB::transaction(function () use ($request) {
$angsuran_pokok = ceil($request->nominal_pinjaman / $request->angsuran);
$bunga = ceil($request->nominal_pinjaman * $request->bunga_pinjaman / 100);
$subtotal_angsuran = ceil($angsuran_pokok + $bunga);
$sisa_lancar_angsuran = ceil($subtotal_angsuran * $request->angsuran);
$pendapatan = $this->hitungKas();
if ($request->nominal_pinjaman > $pendapatan) {
throw new \Exception('Saldo koperasi tidak cukup untuk melanjutkan pengajuan pinjaman.');
}
$pinjaman = new Pinjaman();
$pinjaman->id_anggota = $request->id_anggota;
$pinjaman->no_pinjaman = $this->generateMemberNumber();
$pinjaman->total_pinjaman = $request->nominal_pinjaman;
$pinjaman->angsuran = $request->angsuran;
$pinjaman->sisa_lancar_keseluruhan = round($sisa_lancar_angsuran);
$pinjaman->status_pinjaman = 'Belum Lunas';
$pinjaman->tanggal_realisasi = Carbon::now();
if ($pinjaman->save()) {
$id_pinjaman = $pinjaman->id_pinjaman;
$history = new HistoryTransaksi();
$history->id_users = Auth::user()->id_users;
$history->id_anggota = $request->id_anggota;
$history->id_pinjaman = $id_pinjaman;
$history->tipe_transaksi = 'Pengeluaran';
if (!$history->save()) {
throw new \Exception('Gagal menyimpan data history transaksi.');
}
for ($i = 1; $i <= $request->angsuran; $i++) {
$detail_pinjaman = new DetailPinjaman();
$detail_pinjaman->id_pinjaman = $id_pinjaman;
$detail_pinjaman->id_users = Auth::id();
$detail_pinjaman->angsuran_pokok = round($angsuran_pokok);
$detail_pinjaman->bunga = round($bunga);
$detail_pinjaman->subtotal_angsuran = round($subtotal_angsuran);
$detail_pinjaman->angsuran_ke_ = $i;
$tanggal_jatuh_tempo = Carbon::now()->addMonths($i)->startOfDay();
$detail_pinjaman->tanggal_jatuh_tempo = $tanggal_jatuh_tempo;
if (!$detail_pinjaman->save()) {
throw new \Exception('Gagal menyimpan data detail simpanan.');
}
}
} else {
throw new \Exception('Gagal menyimpan data simpanan.');
}
});
if (Auth::user()->id_role == 2) {
return redirect()->route('pinjaman')->with('success', 'Data pinjaman berhasil ditambahkan.');
} else {
return redirect()->route('pegawai.pinjaman')->with('success', 'Data pinjaman berhasil ditambahkan.');
}
} catch (\Exception $e) {
return back()->withErrors(['error' => $e->getMessage()]);
}
}
/**
* Display the specified resource.
*/
public function show(Request $request, string $id)
{
$pinjaman = Pinjaman::where('id_pinjaman', $id)->with(['anggota', 'detail_pinjaman'])->first();
$detail_pinjaman = DetailPinjaman::where('id_pinjaman', $id)->with(['pinjaman', 'users'])->get();
$rowData = [];
if ($request->ajax()) {
foreach ($detail_pinjaman as $row) {
if ($row->status_pelunasan == 'Belum Lunas') {
if ($row->tanggal_jatuh_tempo < Carbon::now()) {
$row->status_pelunasan = 'Lewat Jatuh Tempo';
$row->save();
}
}
if ($row->status_pelunasan == 'Lewat Jatuh Tempo') {
if ($row->tanggal_jatuh_tempo > Carbon::now()) {
$row->status_pelunasan = 'Belum Lunas';
$row->save();
}
}
$pinjaman = $row->pinjaman;
$rowData[] = [
'DT_RowIndex' => $row->id_pinjaman,
'id_pinjaman' => $pinjaman->id_pinjaman,
'tanggal_jatuh_tempo' => $row->tanggal_jatuh_tempo,
'angsuran_ke_' => $row->angsuran_ke_,
'angsuran_pokok' => $row->angsuran_pokok,
'bunga' => $row->bunga,
'subtotal_angsuran' => $row->subtotal_angsuran,
'status_pelunasan' => $row->status_pelunasan,
'keterangan' => $row->keterangan
];
}
return DataTables::of($rowData)->toJson();
}
$angsuran = DetailPinjaman::where('id_pinjaman', $id)->first();
return view('pages.pinjaman.show', ['pinjaman' => $pinjaman, 'angsuran' => $angsuran]);
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Request $request)
{
return view('pages.pinjaman.edit');
}
public function dataLancar(Request $request)
{
$today = Carbon::now()->startOfDay();
$pinjaman = Pinjaman::whereHas('detail_pinjaman', function ($query) {
$query->where('status_pelunasan', 'Lewat Jatuh Tempo');
})->with('anggota')->get();
$rowData = [];
foreach ($pinjaman as $value) {
$jumlahTerlambat = $value->detail_pinjaman()->where('keterangan', 'Terlambat')->count();
$rowData[] = [
'DT_RowIndex' => $value->id_pinjaman,
'id_pinjaman' => $value->id_pinjaman,
'no_pinjaman' => $value->no_pinjaman,
'nama' => $value->anggota->nama,
'total_pinjaman' => $value->total_pinjaman,
'angsuran' => $value->angsuran,
'sisa_lancar_keseluruhan' => $value->sisa_lancar_keseluruhan,
'status_pinjaman' => $value->status_pinjaman,
'jumlah_terlambat' => $jumlahTerlambat,
];
}
return DataTables::of($rowData)->toJson();
}
public function dataDiragukan(Request $request)
{
$pinjaman = Pinjaman::whereHas('detail_pinjaman', function ($query) {
$query->where('status_pelunasan', 'Lewat Jatuh Tempo');
})->with('anggota')->get();
$rowData = [];
foreach ($pinjaman as $value) {
$jumlahTerlambat = $value->detail_pinjaman()->where('keterangan', 'Terlambat')->count();
$rowData[] = [
'DT_RowIndex' => $value->id_pinjaman,
'id_pinjaman' => $value->id_pinjaman,
'no_pinjaman' => $value->no_pinjaman,
'nama' => $value->anggota->nama,
'total_pinjaman' => $value->total_pinjaman,
'angsuran' => $value->angsuran,
'sisa_lancar_keseluruhan' => $value->sisa_lancar_keseluruhan,
'status_pinjaman' => $value->status_pinjaman,
'jumlah_terlambat' => $jumlahTerlambat,
];
}
return DataTables::of($rowData)->toJson();
}
public function dataMacet(Request $request)
{
$oneYearAgo = Carbon::now()->subYear();
$pinjaman = Pinjaman::whereHas('detail_pinjaman', function ($query) use ($oneYearAgo) {
$query->where('status_pelunasan', 'Lewat Jatuh Tempo')
->where('created_at', '<=', $oneYearAgo);
})->with('anggota')->get();
$rowData = [];
foreach ($pinjaman as $value) {
$jumlahTerlambat = $value->detail_pinjaman()->where('keterangan', 'Terlambat')->count();
$rowData[] = [
'DT_RowIndex' => $value->id_pinjaman,
'id_pinjaman' => $value->id_pinjaman,
'no_pinjaman' => $value->no_pinjaman,
'nama' => $value->anggota->nama,
'total_pinjaman' => $value->total_pinjaman,
'angsuran' => $value->angsuran,
'sisa_lancar_keseluruhan' => $value->sisa_lancar_keseluruhan,
'status_pinjaman' => $value->status_pinjaman,
'jumlah_terlambat' => $jumlahTerlambat,
];
}
return DataTables::of($rowData)->toJson();
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
$validator = Validator::make($request->all(), [
'angsuran' => 'required|numeric|min:1',
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
try {
DB::transaction(function () use ($request, $id) {
$pinjaman = Pinjaman::findOrFail($id);
if (!$pinjaman) {
throw new \Exception('Pinjaman tidak ditemukan. Silahkan coba kembali');
}
$angsuranDibayar = $request->input('angsuran');
$totalAngsuran = $pinjaman->detail_pinjaman()->where('status_pelunasan', '!=', 'Lunas')->count();
if ($angsuranDibayar > $totalAngsuran) {
throw new \Exception('Jumlah angsuran yang akan dibayar melebihi jumlah angsuran yang belum dilunasi');
}
$detailPinjaman = $pinjaman->detail_pinjaman()->where('status_pelunasan', '!=', 'Lunas')->orderBy('angsuran_ke_')->get();
foreach ($detailPinjaman as $index => $detail) {
if ($index < $angsuranDibayar) {
$today = Carbon::now();
$dueDate = Carbon::parse($detail->tanggal_jatuh_tempo);
if ($today->greaterThan($dueDate)) {
$detail->keterangan = 'Terlambat';
} else {
$detail->keterangan = 'Tepat Waktu';
}
$detail->status_pelunasan = 'Lunas';
if (!$detail->save()) {
throw new \Exception('Gagal menyimpan status pelunasan');
}
$history = new HistoryTransaksi();
$history->id_users = Auth::user()->id_users;
$history->id_anggota = $pinjaman->id_anggota;
$history->id_detail_pinjaman = $detail->id;
$history->tipe_transaksi = 'Pemasukan';
if (!$history->save()) {
throw new \Exception('Gagal menyimpan history transaksi');
}
$laporan = new Laporan();
$laporan->id_detail_pinjaman = $detail->id;
$laporan->keterangan = 'Pendapatan Bunga';
$laporan->klasifikasi = 'Pendapatan';
$laporan->jumlah_uang = $detail->bunga;
if (!$laporan->save()) {
throw new \Exception('Gagal menyimpan laporan');
}
} else {
break;
}
}
$subtotal_angsuran = $pinjaman->detail_pinjaman()->where('status_pelunasan', 'Lunas')->first();
if ($subtotal_angsuran) {
$totalDibayar = $subtotal_angsuran->subtotal_angsuran * $angsuranDibayar;
$pinjaman->sisa_lancar_keseluruhan -= $totalDibayar;
$pinjaman->save();
} else {
throw new \Exception('Gagal memperbarui status pinjaman');
}
});
$pinjaman = Pinjaman::findOrFail($id);
$sisaAngsuran = $pinjaman->detail_pinjaman()->where('status_pelunasan', 'Belum Lunas')->count();
if ($sisaAngsuran == 0) {
$pinjaman->status_pinjaman = 'Lunas';
$pinjaman->save();
}
return back()->with(['success' => 'Pelunasan berhasil. Sisa angsuran yang belum dilunasi kurang ' . $sisaAngsuran . 'X']);
} catch (\Exception $e) {
return back()->withErrors(['error' => $e->getMessage()]);
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$pinjaman = Pinjaman::where('id_pinjaman', $id)->first();
$pinjaman->delete();
return redirect()->route('pinjaman')->with('success', 'Pinjaman berhasil dihapus');
}
public function export($id)
{
$data = Pinjaman::find($id);
$dataAnggota = anggota::where('id_anggota', $data->id_anggota)->first();
if ($data) {
$pinjaman = Pinjaman::where('id_pinjaman', $id)->with(['anggota', 'detail_pinjaman'])->get();
$detail_pinjaman = DetailPinjaman::where('id_pinjaman', $id)->with(['pinjaman', 'users'])->get();
$angsuran = DetailPinjaman::where('id_pinjaman', $id)->first();
$html = view('pages.report.pinjaman', [
'pinjaman' => $pinjaman,
'detailPinjaman' => $detail_pinjaman,
'angsuran' => $angsuran,
'id' => $id
])->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream('Pinjaman_' . $dataAnggota->nama . '.pdf');
} else {
return back()->withErrors(['error' => 'Data Pinjaman masih kosong. Silahkan coba kembali.']);
}
}
private function generateMemberNumber()
{
$currentDate = now();
$dateString = $currentDate->format('dmY');
$randomNumber = '';
for ($i = 0; $i < 6; $i++) {
$randomNumber .= mt_rand(0, 9);
}
$memberNumber = 'P' . $dateString . $randomNumber;
return $memberNumber;
}
private function hitungKas()
{
$setor = DetailSimpanan::where('jenis_transaksi', 'Setor')->get();
$simpanan_pokok = $setor->sum('simpanan_pokok');
$simpanan_wajib = $setor->sum('simpanan_wajib');
$simpanan_sukarela = $setor->sum('simpanan_sukarela');
$detail_pinjaman = DetailPinjaman::where('status_pelunasan', 'Lunas')->get();
$angsuran_pokok = $detail_pinjaman->sum('angsuran_pokok');
$pemasukan = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela + $angsuran_pokok;
$tarik = DetailSimpanan::where('jenis_transaksi', 'Tarik')->get();
$totalPenarikanPokok = $tarik->sum('simpanan_pokok');
$totalPenarikanWajib = $tarik->sum('simpanan_wajib');
$totalPenarikanSukarela = $tarik->sum('simpanan_sukarela');
$pinjaman = Pinjaman::where('tanggal_realisasi', '!=', null)->get();
$total_pinjaman = $pinjaman->sum('total_pinjaman');
$pengeluaran = $totalPenarikanPokok + $totalPenarikanWajib + $totalPenarikanSukarela + $total_pinjaman;
$pendapatan = abs($pemasukan - $pengeluaran);
return $pendapatan;
}
}

View File

@ -0,0 +1,134 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class ProfileController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('pages.profile.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
$users = User::find($id);
if (!$users) {
return back()->withErrors(['error' => 'Pengguna tidak ditemukan. Silahkan coba kembali']);
}
if ($request->new_password == null) {
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16|unique:users,nik,' . $id . ',id_users',
'nama' => 'required',
'username' => 'required|unique:users,username,' . $id . ',id_users',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'no_telp' => 'required|numeric',
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$users->nik = $request->nik;
$users->nama = $request->nama;
$users->username = $request->username;
$users->jenis_kelamin = $request->jeniskelamin;
$users->alamat = $request->alamat;
$users->no_telp = $request->no_telp;
} else {
$validator = Validator::make($request->all(), [
'nik' => 'required|digits:16|unique:users,nik,' . $id . ',id_users',
'nama' => 'required',
'username' => 'required|unique:users,username,' . $id . ',id_users',
'jeniskelamin' => 'required|in:Laki-Laki,Perempuan',
'alamat' => 'required',
'no_telp' => 'required|numeric',
'new_password' => 'required|min:8',
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$users->nik = $request->nik;
$users->nama = $request->nama;
$users->username = $request->username;
$users->jenis_kelamin = $request->jeniskelamin;
$users->alamat = $request->alamat;
$users->no_telp = $request->no_telp;
$users->password = Hash::make($request->new_password);
}
if ($users->save()) {
if (Auth::user()->id_role == 1) {
return redirect()->route('admin.profile')->with('success', 'Data Profile berhasil diperbarui.');
} elseif (Auth::user()->id_role == 2) {
return redirect()->route('profile')->with('success', 'Data Profile berhasil diperbarui.');
} else {
return redirect()->route('pegawai.profile')->with('success', 'Data Profile berhasil diperbarui.');
}
} else {
return response()->json(['message' => 'Terjadi kesalahan saat menambahkan data'], 500);
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}

View File

@ -0,0 +1,245 @@
<?php
namespace App\Http\Controllers;
use App\Models\Anggota;
use App\Models\DetailPinjaman;
use App\Models\DetailSimpanan;
use App\Models\HistoryTransaksi;
use App\Models\Pinjaman;
use Carbon\Carbon;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Http\Request;
use Yajra\DataTables\DataTables;
class RekapTransaksiController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request)
{
$query = HistoryTransaksi::with('users', 'anggota', 'detail_simpanan', 'pinjaman', 'detail_pinjaman')->orderBy('created_at', 'desc');
$jumlahMasuk = 0.00;
$jumlahKeluar = 0.00;
$totalPemasukan = 0.00;
$totalPengeluaran = 0.00;
if ($request->has(['start_date', 'end_date'])) {
$startDate = Carbon::parse($request->input('start_date'))->startOfDay();
$endDate = Carbon::parse($request->input('end_date'))->endOfDay();
$query->whereBetween('created_at', [$startDate, $endDate]);
}
$rekap = $query->get();
foreach ($rekap as $item) {
if ($item->id_detail_simpanan != null) {
$detail_simpanan = DetailSimpanan::find($item->id_detail_simpanan);
$simpanan_pokok = $detail_simpanan->simpanan_pokok;
$simpanan_wajib = $detail_simpanan->simpanan_wajib;
$simpanan_sukarela = $detail_simpanan->simpanan_sukarela;
if ($item->tipe_transaksi == 'Pemasukan') {
$jenis_transaksi = 'Setor Simpanan';
$jumlahMasuk = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPemasukan += $jumlahMasuk;
} else {
$jenis_transaksi = 'Tarik Simpanan';
$jumlahKeluar = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPengeluaran += $jumlahKeluar;
}
} elseif ($item->id_pinjaman != null) {
$pinjaman = Pinjaman::find($item->id_pinjaman);
$jumlahKeluar = $pinjaman->total_pinjaman;
$totalPengeluaran += $jumlahKeluar;
$jenis_transaksi = 'Pengajuan Pinjaman';
} else {
$detail_pinjaman = DetailPinjaman::find($item->id_detail_pinjaman);
$jumlahMasuk = $detail_pinjaman->angsuran_pokok;
$totalPemasukan += $jumlahMasuk;
$jenis_transaksi = 'Angsuran Pinjaman';
}
}
$pendapatan = abs($totalPemasukan - $totalPengeluaran);
if ($request->ajax()) {
$rowData = [];
$iteration = 1;
foreach ($rekap as $item) {
$jumlahMasuk = 0.00;
$jumlahKeluar = 0.00;
$totalPemasukan = 0.00;
$totalPengeluaran = 0.00;
if ($item->id_detail_simpanan != null) {
$detail_simpanan = DetailSimpanan::find($item->id_detail_simpanan);
$simpanan_pokok = $detail_simpanan->simpanan_pokok;
$simpanan_wajib = $detail_simpanan->simpanan_wajib;
$simpanan_sukarela = $detail_simpanan->simpanan_sukarela;
if ($item->tipe_transaksi == 'Pemasukan') {
$jenis_transaksi = 'Setor Simpanan';
$jumlahMasuk = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPemasukan += $jumlahMasuk;
} else {
$jenis_transaksi = 'Tarik Simpanan';
$jumlahKeluar = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPengeluaran += $jumlahKeluar;
}
} elseif ($item->id_pinjaman != null) {
$pinjaman = Pinjaman::find($item->id_pinjaman);
$jumlahKeluar = $pinjaman->total_pinjaman;
$totalPengeluaran += $jumlahKeluar;
$jenis_transaksi = 'Pengajuan Pinjaman';
} else {
$detail_pinjaman = DetailPinjaman::find($item->id_detail_pinjaman);
$jumlahMasuk = $detail_pinjaman->angsuran_pokok;
$totalPemasukan += $jumlahMasuk;
$jenis_transaksi = 'Angsuran Pinjaman';
}
$rowData[] = [
'DT_RowIndex' => $iteration,
'nama_pengguna' => $item->users->nama,
'anggota' => $item->anggota->nama,
'jenis_transaksi' => $jenis_transaksi,
'tanggal' => $item->created_at->format('d-m-Y h:i:s'),
'jumlah_masuk' => $jumlahMasuk,
'jumlah_keluar' => $jumlahKeluar,
];
$iteration++;
}
return DataTables::of($rowData)->toJson();
}
return view('pages.rekap.index', ['pendapatan' => $pendapatan, 'totalPemasukan' => $totalPemasukan, 'totalPengeluaran' => $totalPengeluaran]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
public function export(Request $request)
{
$data = HistoryTransaksi::all();
if ($data) {
$startDate = Carbon::parse($request->input('start_date'))->startOfDay();
$endDate = Carbon::parse($request->input('end_date'))->endOfDay();
$tahun = Carbon::now()->format('Y');
$rekapData = HistoryTransaksi::with('users', 'detail_simpanan', 'pinjaman', 'detail_pinjaman')->whereBetween('created_at', [$startDate, $endDate])->orderBy('created_at', 'desc')->get();
$jumlah_masuk = [];
$jumlah_keluar = [];
$totalPemasukan = 0.00;
$totalPengeluaran = 0.00;
foreach ($rekapData as $item) {
$jumlahMasuk = 0.00;
$jumlahKeluar = 0.00;
if ($item->id_detail_simpanan !== null) {
$detail_simpanan = DetailSimpanan::find($item->id_detail_simpanan);
$simpanan_pokok = $detail_simpanan->simpanan_pokok;
$simpanan_wajib = $detail_simpanan->simpanan_wajib;
$simpanan_sukarela = $detail_simpanan->simpanan_sukarela;
if ($item->tipe_transaksi == 'Pemasukan') {
$jenis_transaksi = 'Setor Simpanan';
$jumlahMasuk = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPemasukan += $jumlahMasuk;
} else {
$jenis_transaksi = 'Tarik Simpanan';
$jumlahKeluar = $simpanan_pokok + $simpanan_wajib + $simpanan_sukarela;
$totalPengeluaran += $jumlahKeluar;
}
} elseif ($item->id_pinjaman !== null) {
$pinjaman = Pinjaman::find($item->id_pinjaman);
if (!$pinjaman) {
$jumlahKeluar = 0.00;
} else {
$jumlahKeluar = $pinjaman->total_pinjaman;
}
$totalPengeluaran += $jumlahKeluar;
$jenis_transaksi = 'Pengajuan Pinjaman';
} else {
$detail_pinjaman = DetailPinjaman::find($item->id_detail_pinjaman);
if (!$detail_pinjaman) {
$jumlahMasuk = 0.00;
} else {
$jumlahMasuk = $detail_pinjaman->angsuran_pokok;
}
$totalPemasukan += $jumlahMasuk;
$jenis_transaksi = 'Angsuran Pinjaman';
}
array_push($jumlah_masuk, $jumlahMasuk);
array_push($jumlah_keluar, $jumlahKeluar);
}
$pendapatan = abs($totalPemasukan - $totalPengeluaran);
$html = view('pages.report.rekap', ['rekapData' => $rekapData, 'pendapatan' => $pendapatan, 'totalPemasukan' => $totalPemasukan, 'totalPengeluaran' => $totalPengeluaran, 'tahun' => $tahun, 'jenis_transaksi' => $jenis_transaksi, 'jumlah_masuk' => $jumlah_masuk, 'jumlah_keluar' => $jumlah_keluar])->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('Rekap Transaksi.pdf');
} else {
return back()->withErrors(['error' => 'Data Rekap Transaksi masih kosong. Silahkan coba kembali.']);
}
}
}

View File

@ -0,0 +1,582 @@
<?php
namespace App\Http\Controllers;
use App\Exports\ExportSimpananAnggota;
use App\Models\anggota;
use App\Models\DetailSimpanan;
use App\Models\HistoryTransaksi;
use App\Models\simpanan;
use App\Models\User;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Maatwebsite\Excel\Facades\Excel;
use Yajra\DataTables\DataTables;
class SimpananController extends Controller
{
public function index(Request $request)
{
$simpanan = simpanan::with('anggota')->get();
if ($request->ajax()) {
return DataTables::of($simpanan)
->addColumn('DT_RowIndex', function ($simpanan) {
return $simpanan->id_users;
})
->addColumn('no_anggota', function ($simpanan) {
return $simpanan->anggota->no_anggota;
})
->addColumn('jenis_anggota', function ($simpanan) {
return $simpanan->anggota->jenis_anggota;
})
->addColumn('nama', function ($simpanan) {
return $simpanan->anggota->nama;
})
->addColumn('alamat', function ($simpanan) {
return $simpanan->anggota->alamat;
})
->toJson();
}
return view('pages.simpanan.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('pages.simpanan.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'id_anggota' => 'required|exists:anggota,id_anggota',
'jenis_simpanan' => 'required|in:Simpanan Pokok,Simpanan Wajib,Simpanan Sukarela',
'nominal' => 'required|numeric|regex:/^\d+(\.\d{1,2})?$/'
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$anggota = anggota::find($request->id_anggota);
if ($anggota->simpanan) {
return redirect()->back()->with(['error' => 'Anggota sudah memiliki simpanan.']);
}
try {
DB::transaction(function () use ($request) {
$simpanan = new Simpanan();
$simpanan->id_anggota = $request->id_anggota;
$simpanan->total_saldo = $request->nominal;
if ($simpanan->save()) {
$id_simpanan = $simpanan->id_simpanan;
$detail_simpanan = new DetailSimpanan();
$detail_simpanan->id_simpanan = $id_simpanan;
$detail_simpanan->id_users = Auth::id();
$detail_simpanan->jenis_transaksi = 'Setor';
$detail_simpanan->subtotal_saldo = $request->nominal;
if ($request->jenis_simpanan == 'Simpanan Pokok') {
if ($request->jenis_anggota == 'Pendiri') {
if ($request->nominal == 500000) {
$detail_simpanan->simpanan_pokok = $request->nominal;
} else {
throw new \Exception('Simpanan pokok anggota pendiri harus Rp. 500.000.');
}
} else {
if ($request->nominal == 100000) {
$detail_simpanan->simpanan_pokok = $request->nominal;
} else {
throw new \Exception('Simpanan pokok anggota biasa harus Rp. 100.000.');
}
}
} else {
throw new \Exception('Anggota belum memiliki simpanan pokok');
}
if (!$detail_simpanan->save()) {
throw new \Exception('Gagal menyimpan data detail simpanan.');
}
$history = new HistoryTransaksi();
$history->id_users = Auth::user()->id_users;
$history->id_anggota = $request->id_anggota;
$history->id_detail_simpanan = $detail_simpanan->id;
$history->tipe_transaksi = 'Pemasukan';
if (!$history->save()) {
throw new \Exception('Gagal menyimpan data history transaksi.');
}
} else {
throw new \Exception('Gagal menyimpan data simpanan.');
}
});
if (Auth::user()->id_role == 2) {
return redirect()->route('simpanan')->with('success', 'Data simpanan berhasil ditambahkan.');
} else {
return redirect()->route('pegawai.simpanan')->with('success', 'Data simpanan berhasil ditambahkan.');
}
} catch (\Exception $e) {
return back()->withErrors(['error' => $e->getMessage()]);
}
}
/**
* Display the specified resource.
*/
public function show(Request $request, string $id)
{
$simpanan = simpanan::where('id_simpanan', '=', $id)->with('anggota')->first();
$detail_simpanan = DetailSimpanan::where('id_simpanan', $id)->with(['simpanan'])->orderBy('created_at', 'desc')->get();
$setor = DetailSimpanan::where('id_simpanan', $id)
->where('jenis_transaksi', '=', 'Setor')
->get();
$tarik = DetailSimpanan::where('id_simpanan', $id)
->where('jenis_transaksi', '=', 'Tarik')
->get();
$totalSimpananPokok = $setor->sum('simpanan_pokok');
$totalSimpananWajib = $setor->sum('simpanan_wajib');
$totalSimpananSukarela = $setor->sum('simpanan_sukarela');
$totalPenarikanPokok = $tarik->sum('simpanan_pokok');
$totalPenarikanWajib = $tarik->sum('simpanan_wajib');
$totalPenarikanSukarela = $tarik->sum('simpanan_sukarela');
$totalSimpananPokok -= $totalPenarikanPokok;
$totalSimpananWajib -= $totalPenarikanWajib;
$totalSimpananSukarela -= $totalPenarikanSukarela;
$rowData = [];
if ($request->ajax()) {
foreach ($detail_simpanan as $row) {
$simpanan = $row->simpanan;
$anggota = $simpanan->anggota;
$rowData[] = [
'id' => $row->id,
'DT_RowIndex' => $row->id_simpanan,
'id_simpanan' => $simpanan->id_simpanan,
'jenis_anggota' => $anggota->jenis_anggota,
'total_saldo' => $simpanan->total_saldo,
'jenis_transaksi' => $row->jenis_transaksi,
'simpanan_pokok' => $row->simpanan_pokok,
'simpanan_wajib' => $row->simpanan_wajib,
'simpanan_sukarela' => $row->simpanan_sukarela,
'subtotal_saldo' => $row->subtotal_saldo,
'created_at' => $row->created_at->format('d-m-Y h:i:s')
];
}
return DataTables::of($rowData)->toJson();
}
return view('pages.simpanan.show', [
'simpanan' => $simpanan,
'total_simpanan_pokok' => $totalSimpananPokok,
'total_simpanan_wajib' => $totalSimpananWajib,
'total_simpanan_sukarela' => $totalSimpananSukarela
]);
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
return view('pages.simpanan.edit', compact($id));
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
if ($request->id_anggota == 'update_detail') {
$validator = Validator::make($request->all(), [
'jenis_transaksi' => 'required|in:Setor,Tarik',
'nominal_simpanan_pokok' => 'numeric|regex:/^\d+(\.\d{1,2})?$/',
'nominal_simpanan_wajib' => 'numeric|regex:/^\d+(\.\d{1,2})?$/',
'nominal_simpanan_sukarela' => 'numeric|regex:/^\d+(\.\d{1,2})?$/'
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
$jenisAnggota = $request->jenis_anggota;
$jenisTransaksiLama = $request->jenis_lama;
$jenisTransaksi = $request->jenis_transaksi;
$subtotal_saldo = $request->subtotal_saldo_saat_ini;
$nominalBaruSimpananPokok = $request->nominal_simpanan_pokok;
$nominalBaruSimpananWajib = $request->nominal_simpanan_wajib;
$nominalBaruSimpananSukarela = $request->nominal_simpanan_sukarela;
$nominalLamaSimpananSukarela = $request->nominal_lama;
$targetRow = DetailSimpanan::where('id_simpanan', $id)->where('subtotal_saldo', $subtotal_saldo)->first();
$simpanan = simpanan::where('id_simpanan', $id)->first();
if ($targetRow) {
$dataDetailSimpanan = DetailSimpanan::where('id_simpanan', $id)->where('created_at', '>=', $targetRow->created_at)->get();
$simpananSukarelaSetor = DetailSimpanan::where('id_simpanan', '=', $id)
->where('jenis_transaksi', '=', 'Setor')
->sum('simpanan_sukarela');
$simpananSukarelaTarik = DetailSimpanan::where('id_simpanan', '=', $id)
->where('jenis_transaksi', '=', 'Tarik')
->sum('simpanan_sukarela');
$simpananSukarela = $simpananSukarelaSetor - $simpananSukarelaTarik;
// dd($dataDetailSimpanan);
foreach ($dataDetailSimpanan as $detailSimpanan) {
if ($request->nominal_simpanan_sukarela != 0 && $request->nominal_simpanan_wajib != 0) {
if ($jenisTransaksi == 'Setor') {
$simpanan_wajib = DetailSimpanan::where('id_simpanan', '=', $id)->whereNotNull('simpanan_wajib')->first('simpanan_wajib');
if ($simpanan_wajib) {
$simpanan_wajib_sebelum = $simpanan_wajib->simpanan_wajib;
if ($simpanan_wajib_sebelum > 0) {
if ($nominalBaruSimpananWajib == $simpanan_wajib_sebelum) {
$selisih = abs($nominalBaruSimpananSukarela - $nominalLamaSimpananSukarela);
if ($nominalBaruSimpananSukarela > $nominalLamaSimpananSukarela) {
$detailSimpanan->subtotal_saldo += $selisih;
} else {
$detailSimpanan->subtotal_saldo -= $selisih;
}
$targetRow->simpanan_wajib = $nominalBaruSimpananWajib;
$targetRow->simpanan_sukarela = $nominalBaruSimpananSukarela;
} else {
if ($nominalBaruSimpananWajib > $simpanan_wajib_sebelum) {
$targetRow->simpanan_wajib = $simpanan_wajib_sebelum;
$targetRow->simpanan_sukarela = $nominalBaruSimpananWajib - $simpanan_wajib_sebelum;
} else {
return back()->with('error', 'Simpanan Wajib harus senilai dengan setoran sebelumnya yaitu Rp ' . number_format($simpanan_wajib_sebelum, 2, ',', '.'));
}
}
} else {
$selisih = abs($nominalBaruSimpananSukarela - $nominalLamaSimpananSukarela);
if ($nominalBaruSimpananSukarela > $nominalLamaSimpananSukarela) {
$detailSimpanan->subtotal_saldo += $selisih;
} else {
$detailSimpanan->subtotal_saldo -= $selisih;
}
$targetRow->simpanan_wajib = $nominalBaruSimpananWajib;
$targetRow->simpanan_sukarela = $nominalBaruSimpananSukarela;
}
} else {
$selisih = abs($nominalBaruSimpananSukarela - $nominalLamaSimpananSukarela);
if ($nominalBaruSimpananSukarela > $nominalLamaSimpananSukarela) {
$detailSimpanan->subtotal_saldo += $selisih;
} else {
$detailSimpanan->subtotal_saldo -= $selisih;
}
$targetRow->simpanan_wajib = $nominalBaruSimpananWajib;
$targetRow->simpanan_sukarela = $nominalBaruSimpananSukarela;
}
} else {
if ($request->nominal_simpanan_wajib != 0) {
return back()->with('error', 'Simpanan wajib tidak bisa ditarik');
}
}
} elseif ($request->nominal_simpanan_sukarela != 0) {
if ($jenisTransaksi == 'Setor') {
$selisih = abs($nominalBaruSimpananSukarela - $nominalLamaSimpananSukarela);
if ($nominalBaruSimpananSukarela > $nominalLamaSimpananSukarela) {
$detailSimpanan->subtotal_saldo += $selisih;
} else {
$detailSimpanan->subtotal_saldo -= $selisih;
}
$targetRow->simpanan_sukarela = $nominalBaruSimpananSukarela;
} else {
if ($simpananSukarela > $nominalBaruSimpananSukarela) {
return back()->with('error', 'Jenis Transaksi berbeda');
} else {
return back()->with('error', 'Saldo Simpanan sukarela tidak cukup');
}
}
} elseif ($request->nominal_simpanan_wajib != 0) {
if ($nominalBaruSimpananSukarela) {
if ($nominalBaruSimpananSukarela == 0) {
$selisih = abs($nominalBaruSimpananSukarela - $nominalLamaSimpananSukarela);
if ($nominalBaruSimpananSukarela > $nominalLamaSimpananSukarela) {
$detailSimpanan->subtotal_saldo += $selisih;
} else {
$detailSimpanan->subtotal_saldo -= $selisih;
}
$targetRow->simpanan_sukarela = null;
}
} else {
if ($jenisTransaksi == 'Setor') {
return back()->with('error', 'Simpanan wajib sudah valid');
} else {
return back()->with('error', 'Simpanan wajib tidak bisa ditarik');
}
}
} else {
if ($jenisTransaksi == 'Setor') {
return back()->with('error', 'Simpanan pokok sudah valid');
} else {
return back()->with('error', 'Simpanan pokok tidak bisa ditarik');
}
}
$saved = $detailSimpanan->save();
if (!$saved) {
return back()->with('error', 'Gagal menyimpan perubahan pada DetailSimpanan.');
}
$dataUpdate[] = $detailSimpanan;
}
$dataUpdateRow[] = $targetRow;
$savedTargetRow = $targetRow->save();
if (!$savedTargetRow) {
return back()->with('error', 'Gagal menyimpan perubahan pada targetRow.');
}
$dataSubtotal = DetailSimpanan::orderBy('created_at', 'desc')
->first();
$simpanan->total_saldo = $dataSubtotal->subtotal_saldo;
$savedTotal = $simpanan->save();
if (!$savedTotal) {
return back()->with('error', 'Gagal menyimpan perubahan pada total saldo.');
}
if (Auth::user()->id_role == 2) {
return back()->with('success', 'Data detail simpanan berhasil diperbarui.');
} else {
return back()->with('success', 'Data detail simpanan berhasil diperbarui.');
}
} else {
return back()->with('error', 'Baris tidak ditemukan.');
}
} else {
$data = simpanan::find($id);
$detail_simpanan_sukarela = DetailSimpanan::where('id_simpanan', '=', $id)->sum('simpanan_sukarela');
if (!$data) {
return back()->with(['error' => 'Simpanan tidak ditemukan. Silahkan coba kembali']);
}
$validator = Validator::make($request->all(), [
'id_anggota' => 'required|exists:anggota,id_anggota',
'jenis_simpanan' => 'required|in:Simpanan Pokok,Simpanan Wajib,Simpanan Sukarela',
'nominal' => 'required|numeric|regex:/^\d+(\.\d{1,2})?$/'
]);
if ($validator->fails()) {
return back()
->withErrors($validator)
->withInput();
}
try {
$saldoSebelumSetoran = $data->total_saldo;
$jenisTransaksi = $request->jenis_transaksi;
$jenisSimpanan = $request->jenis_simpanan;
$jenisAnggota = $request->jenis_anggota;
if ($jenisTransaksi == 'Setor') {
$saldoSebelumSetoran += $request->nominal;
$data->total_saldo += $request->nominal;
} elseif ($jenisTransaksi == 'Tarik') {
if ($jenisSimpanan == 'Simpanan Sukarela' && $request->nominal > $detail_simpanan_sukarela) {
throw new \Exception('Transaksi gagal. Saldo sukarela tidak cukup');
}
$saldoSebelumSetoran -= $request->nominal;
$data->total_saldo -= $request->nominal;
}
DB::transaction(function () use ($data, $saldoSebelumSetoran, $jenisTransaksi, $jenisSimpanan, $request) {
$detail_simpanan = new DetailSimpanan();
$detail_simpanan->id_simpanan = $data->id_simpanan;
$detail_simpanan->id_users = Auth::id();
$detail_simpanan->jenis_transaksi = $jenisTransaksi;
$detail_simpanan->subtotal_saldo = $saldoSebelumSetoran;
if ($jenisSimpanan == 'Simpanan Wajib') {
$simpanan_wajib = DetailSimpanan::where('id_simpanan', '=', $data->id_simpanan)->whereNotNull('simpanan_wajib')->first('simpanan_wajib');
if ($simpanan_wajib) {
$simpanan_wajib_sebelum = $simpanan_wajib->simpanan_wajib;
if ($simpanan_wajib_sebelum > 0) {
if ($request->nominal == $simpanan_wajib_sebelum) {
$detail_simpanan->simpanan_wajib = $request->nominal;
} else {
if ($request->nominal > $simpanan_wajib_sebelum) {
$detail_simpanan->simpanan_wajib = $simpanan_wajib_sebelum;
$detail_simpanan->simpanan_sukarela = $request->nominal - $simpanan_wajib_sebelum;
} else {
throw new \Exception('Simpanan Wajib harus senilai dengan setoran sebelumnya yaitu Rp ' . number_format($simpanan_wajib_sebelum, 2, ',', '.'));
}
}
} else {
$detail_simpanan->simpanan_wajib = $request->nominal;
}
} else {
$detail_simpanan->simpanan_wajib = $request->nominal;
}
} else {
$detail_simpanan->simpanan_sukarela = $request->nominal;
}
if (!$data->save() || !$detail_simpanan->save()) {
throw new \Exception('Gagal menyimpan transaksi simpanan. Silahkan coba lagi');
}
$history = new HistoryTransaksi();
$history->id_users = Auth::user()->id_users;
$history->id_anggota = $request->id_anggota;
$history->id_detail_simpanan = $detail_simpanan->id;
if ($jenisTransaksi == 'Setor') {
$history->tipe_transaksi = 'Pemasukan';
} else {
$history->tipe_transaksi = 'Pengeluaran';
}
if (!$history->save()) {
throw new \Exception('Gagal menyimpan data history transaksi.');
}
});
if (Auth::user()->id_role == 2) {
return redirect()->route('simpanan')->with('success', 'Data simpanan berhasil disimpan.');
} else {
return redirect()->route('pegawai.simpanan')->with('success', 'Data simpanan berhasil disimpan.');
}
} catch (\Exception $e) {
return back()->withErrors(['error' => $e->getMessage()]);
}
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
$detail = simpanan::where('id_simpanan', $id)->first();
$detail->delete();
return redirect()->route('simpanan')->with('success', 'Simpanan berhasil dihapus');
}
/**
* Remove the specified resource from storage.
*/
public function destroyDetail(string $id)
{
$detail = DetailSimpanan::where('id', $id)->first();
if ($detail) {
$jenis_transaksi = $detail->jenis_transaksi;
$simpanan_pokok = $detail->simpanan_pokok;
$simpanan_wajib = $detail->simpanan_wajib;
if ($simpanan_pokok > 0) {
return back()->with('error', 'Simpanan Pokok tidak dapat dihapus.');
// } elseif ($simpanan_wajib > 0) {
// return back()->with('error', 'Simpanan Wajib tidak dapat dihapus.');
} else {
$simpanan = Simpanan::where('id_simpanan', $detail->id_simpanan)->first();
$saldoSebelum = 0.00;
$dataDetailSimpananSebelum = DetailSimpanan::where('id_simpanan', $detail->id_simpanan)
->where('created_at', '<', $detail->created_at)
->orderBy('created_at', 'desc')
->first();
if ($dataDetailSimpananSebelum) {
$saldoSebelum = $dataDetailSimpananSebelum->subtotal_saldo;
}
$detail->delete();
$detailSetelah = DetailSimpanan::where('id_simpanan', $detail->id_simpanan)
->where('created_at', '>', $detail->created_at)
->first();
$saldoSetelah = $saldoSebelum;
if ($detailSetelah) {
$saldoSetelah += $detailSetelah->simpanan_sukarela;
}
$detail->subtotal_saldo = $saldoSetelah;
$simpanan->total_saldo = $saldoSetelah;
$saved = $simpanan->save();
if ($saved) {
return back()->with('success', 'Data detail simpanan berhasil dihapus.');
} else {
return back()->with('error', 'Gagal menyimpan perubahan pada total saldo.');
}
}
} else {
return back()->with('error', 'Detail Simpanan tidak ditemukan.');
}
}
public function export($id)
{
$data = simpanan::find($id);
$dataAnggota = anggota::where('id_anggota', $data->id_anggota)->first();
if ($data) {
$simpanan = Simpanan::with(['anggota', 'detail_simpanan'])->where('id_simpanan', $id)->get();
$detail_simpanan = DetailSimpanan::where('id_simpanan', $id)->with(['simpanan'])->get();
$setor = DetailSimpanan::where('id_simpanan', $id)
->where('jenis_transaksi', '=', 'Setor')
->get();
$tarik = DetailSimpanan::where('id_simpanan', $id)
->where('jenis_transaksi', '=', 'Tarik')
->get();
$totalSimpananPokok = $setor->sum('simpanan_pokok');
$totalSimpananWajib = $setor->sum('simpanan_wajib');
$totalSimpananSukarela = $setor->sum('simpanan_sukarela');
$totalPenarikanPokok = $tarik->sum('simpanan_pokok');
$totalPenarikanWajib = $tarik->sum('simpanan_wajib');
$totalPenarikanSukarela = $tarik->sum('simpanan_sukarela');
$totalSimpananPokok -= $totalPenarikanPokok;
$totalSimpananWajib -= $totalPenarikanWajib;
$totalSimpananSukarela -= $totalPenarikanSukarela;
$html = view('pages.report.simpanan', [
'simpanan' => $simpanan,
'detailSimpanan' => $detail_simpanan,
'totalSimpananPokok' => $totalSimpananPokok,
'totalSimpananWajib' => $totalSimpananWajib,
'totalSimpananSukarela' => $totalSimpananSukarela,
'id' => $id
])->render();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream('Simpanan_' . $dataAnggota->nama . '.pdf');
} else {
return back()->withErrors(['error' => 'Data Simpanan masih kosong. Silahkan coba kembali.']);
}
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Http\Controllers;
use App\Models\user;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function page()
{
return redirect()->route('user');
}
public function index(Request $request)
{
if($request->has('search')){
$data = user::where('name', 'LIKE', '%'.$request->search.'%')->paginate(5);
}else{
$data = user::paginate(5); }
return view('user', compact('data'));
}
// public function tambah()
// {
// return view('anggota');
// }
// public function insert(Request $request)
// {
// $request->validate([
// 'name' => 'required',
// 'email' => 'required',
// 'password' => 'required',
// 'number' => 'required',
// ]);
// $validatedData['name'] = $request->name;
// $validatedData['email'] = $request->email;
// $validatedData['password'] =Hash::make($request->password);
// $validatedData['number'] = $request->number;
// User::create($validatedData);
// return redirect()->route('admin.admins')->with('success','Data Berhasil Ditambahkan');
// }
// public function tampil($id)
// {
// $data = User::find($id);
// return view('admintampildata', compact('data'));
// }
// public function update(Request $request, $id)
// {
// $data = User::find($id);
// $data->update($request->all());
// return redirect()->route('admin.admins')->with('success','Data Berhasil Di Update');
// }
public function delete($id)
{
$data = user::find($id);
$data->delete();
return redirect()->route('user')->with('success','Data Berhasil Di Hapus');
}
}

73
app/Http/Kernel.php Normal file
View File

@ -0,0 +1,73 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's middleware aliases.
*
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'ceklevel' => \App\Http\Middleware\CekLevel::class,
'only_sign_in' => \App\Http\Middleware\Only_Sign_In::class,
'admin' => \App\Http\Middleware\Only_Admin::class,
'pengurus' => \App\Http\Middleware\Only_Kepala_Koperasi::class,
'pegawai' => \App\Http\Middleware\Only_Pegawai::class,
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('login');
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class CekLevel
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, ...$levels): Response
{
if (in_array($request->user()->level,$levels)){
return $next($request);
}
// Simpan URL saat ini
$previousUrl = url()->previous();
// Jika URL sebelumnya adalah URL saat ini, maka arahkan ke halaman utama
if ($previousUrl == $request->url()) {
return redirect('/');
}
// Jika URL sebelumnya bukan URL saat ini, arahkan kembali ke URL sebelumnya
return redirect()->to($previousUrl);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class Only_Admin
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()->id_role != '1') {
if (Auth::user()->id_role == '2') {
return redirect('dashboard');
}
}
return $next($request);
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class Only_Kepala_Koperasi
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()->id_role != '2') {
if (Auth::user()->id_role == '1') {
return redirect('admin/dashboard');
} else {
return redirect('dashboard');
}
}
return $next($request);
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class Only_Pegawai
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()->id_role != '3') {
if (Auth::user()->id_role == '1') {
return redirect('admin/dashboard');
} else {
return redirect('pengurus/dashboard');
}
}
return $next($request);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class Only_Sign_In
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()) {
if (Auth::user()->id_role == '1') {
return redirect('admin/dashboard');
}
if (Auth::user()->id_role == '2') {
return redirect('dashboard');
}
}
return $next($request);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

43
app/Models/Anggota.php Normal file
View File

@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Anggota extends Model
{
use HasFactory;
protected $table = 'anggota';
protected $primaryKey = 'id_anggota';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function simpanan()
{
return $this->hasOne(Simpanan::class, 'id_anggota', 'id_anggota');
}
public function pinjaman()
{
return $this->hasMany(Pinjaman::class, 'id_anggota', 'id_anggota');
}
public function hasSimpanan()
{
return $this->simpanan()->exists();
}
public function hasPinjaman()
{
return $this->pinjaman()->exists();
}
public function history_transaksi()
{
return $this->hasMany(HistoryTransaksi::class, 'id_anggota', 'id_anggota');
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DetailPinjaman extends Model
{
use HasFactory;
protected $table = 'detail_pinjaman';
protected $primaryKey = 'id';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function pinjaman()
{
return $this->belongsTo(Pinjaman::class, 'id_pinjaman', 'id_pinjaman');
}
public function history_transaksi()
{
return $this->hasMany(HistoryTransaksi::class, 'id_detail_pinjaman', 'id_detail_pinjaman');
}
public function laporan()
{
return $this->hasMany(Laporan::class, 'id_detail_pinjaman', 'id_detail_pinjaman');
}
public function users()
{
return $this->belongsTo(User::class, 'id_users', 'id_users');
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DetailSimpanan extends Model
{
use HasFactory;
protected $table = 'detail_simpanan';
protected $primaryKey = 'id';
protected $guarded = [];
// protected $dates = [
// 'created_at' => 'datetime',
// 'updated_at' => 'datetime',
// ];
public function simpanan()
{
return $this->belongsTo(Simpanan::class, 'id_simpanan', 'id_simpanan');
}
public function history_transaksi()
{
return $this->hasMany(HistoryTransaksi::class, 'id_detail_simpanan', 'id_detail_simpanan');
}
public function users()
{
return $this->belongsTo(User::class, 'id_users', 'id_users');
}
}

View File

@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class HistoryTransaksi extends Model
{
use HasFactory;
protected $table = 'history_transaksi';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function detail_simpanan()
{
return $this->belongsTo(DetailSimpanan::class, 'id', 'id');
}
public function pinjaman()
{
return $this->belongsTo(Pinjaman::class, 'id_pinjaman', 'id_pinjaman');
}
public function detail_pinjaman()
{
return $this->belongsTo(DetailPinjaman::class, 'id', 'id');
}
public function users()
{
return $this->belongsTo(User::class, 'id_users', 'id_users');
}
public function anggota()
{
return $this->belongsTo(Anggota::class, 'id_anggota', 'id_anggota');
}
}

23
app/Models/Laporan.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Laporan extends Model
{
use HasFactory;
protected $table = 'laporan';
protected $primaryKey = 'id';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function detail_pinjaman()
{
return $this->belongsTo(DetailPinjaman::class, 'id', 'id');
}
}

33
app/Models/Pinjaman.php Normal file
View File

@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Pinjaman extends Model
{
use HasFactory;
protected $table = 'pinjaman';
protected $primaryKey = 'id_pinjaman';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function anggota()
{
return $this->belongsTo(Anggota::class, 'id_anggota', 'id_anggota');
}
public function detail_pinjaman()
{
return $this->hasMany(DetailPinjaman::class, 'id_pinjaman', 'id_pinjaman');
}
public function history_transaksi()
{
return $this->hasMany(HistoryTransaksi::class, 'id_pinjaman', 'id_pinjaman');
}
}

22
app/Models/Role.php Normal file
View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Role extends Model
{
use HasFactory;
protected $table = 'role';
protected $primaryKey = 'id_role';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function user()
{
return $this->hasOne(User::class, 'id_users');
}
}

28
app/Models/Simpanan.php Normal file
View File

@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Simpanan extends Model
{
use HasFactory;
protected $table = 'simpanan';
protected $primaryKey = 'id_simpanan';
protected $guarded = [];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function anggota()
{
return $this->belongsTo(Anggota::class, 'id_anggota', 'id_anggota');
}
public function detail_simpanan()
{
return $this->hasMany(DetailSimpanan::class, 'id_simpanan', 'id_simpanan');
}
}

72
app/Models/User.php Normal file
View File

@ -0,0 +1,72 @@
<?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;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $primaryKey = 'id_users';
protected $fillable = [
'nama',
'username',
'password',
'noTelp',
'alamat',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'password' => 'hashed',
];
protected $attributes = [
'id_role' => 3,
];
public function role()
{
return $this->belongsTo(Role::class, 'id_role', 'id_role');
}
public function detail_simpanan()
{
return $this->hasMany(DetailSimpanan::class, 'id_users', 'id_users');
}
public function detail_pinjaman()
{
return $this->hasMany(DetailPinjaman::class, 'id_users', 'id_users');
}
public function history_transaksi()
{
return $this->hasMany(HistoryTransaksi::class, 'id_users', 'id_users');
}
}

View 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
{
//
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to your application's "home" route.
*
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';
/**
* Define your route model bindings, pattern filters, and other route configuration.
*/
public function boot(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
$this->routes(function () {
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
}

53
artisan Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

73
composer.json Normal file
View File

@ -0,0 +1,73 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.1",
"arielmejiadev/larapex-charts": "^8.1",
"dompdf/dompdf": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"rap2hpoutre/fast-excel": "^5.4",
"yajra/laravel-datatables": "10.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"files": [
"app/Helpers/Helper.php"
],
"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"
]
},
"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
}

9178
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

191
config/app.php Normal file
View File

@ -0,0 +1,191 @@
<?php
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'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
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'Asia/Jakarta',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| 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' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Yajra\DataTables\DataTablesServiceProvider::class,
// Maatwebsite\Excel\ExcelServiceProvider::class,
])->toArray(),
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => Facade::defaultAliases()->merge([
// 'Example' => App\Facades\Example::class,
// 'Excel' => Maatwebsite\Excel\Facades\Excel::class,
])->toArray(),
];

115
config/auth.php Normal file
View File

@ -0,0 +1,115 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| 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' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

71
config/broadcasting.php Normal file
View File

@ -0,0 +1,71 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

111
config/cache.php Normal file
View File

@ -0,0 +1,111 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| 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: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'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' => '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, or 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_'),
];

34
config/cors.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];

151
config/database.php Normal file
View File

@ -0,0 +1,151 @@
<?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 all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'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('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'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 in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| 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 APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'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'),
],
],
];

127
config/datatables.php Normal file
View File

@ -0,0 +1,127 @@
<?php
return [
/*
* DataTables search options.
*/
'search' => [
/*
* Smart search will enclose search keyword with wildcard string "%keyword%".
* SQL: column LIKE "%keyword%"
*/
'smart' => true,
/*
* Multi-term search will explode search keyword using spaces resulting into multiple term search.
*/
'multi_term' => true,
/*
* Case insensitive will search the keyword in lower case format.
* SQL: LOWER(column) LIKE LOWER(keyword)
*/
'case_insensitive' => true,
/*
* Wild card will add "%" in between every characters of the keyword.
* SQL: column LIKE "%k%e%y%w%o%r%d%"
*/
'use_wildcards' => false,
/*
* Perform a search which starts with the given keyword.
* SQL: column LIKE "keyword%"
*/
'starts_with' => false,
],
/*
* DataTables internal index id response column name.
*/
'index_column' => 'DT_RowIndex',
/*
* List of available builders for DataTables.
* This is where you can register your custom dataTables builder.
*/
'engines' => [
'eloquent' => Yajra\DataTables\EloquentDataTable::class,
'query' => Yajra\DataTables\QueryDataTable::class,
'collection' => Yajra\DataTables\CollectionDataTable::class,
'resource' => Yajra\DataTables\ApiResourceDataTable::class,
],
/*
* DataTables accepted builder to engine mapping.
* This is where you can override which engine a builder should use
* Note, only change this if you know what you are doing!
*/
'builders' => [
//Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent',
//Illuminate\Database\Eloquent\Builder::class => 'eloquent',
//Illuminate\Database\Query\Builder::class => 'query',
//Illuminate\Support\Collection::class => 'collection',
],
/*
* Nulls last sql pattern for PostgreSQL & Oracle.
* For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction'
*/
'nulls_last_sql' => ':column :direction NULLS LAST',
/*
* User friendly message to be displayed on user if error occurs.
* Possible values:
* null - The exception message will be used on error response.
* 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed.
* 'custom message' - Any friendly message to be displayed to the user. You can also use translation key.
*/
'error' => env('DATATABLES_ERROR', null),
/*
* Default columns definition of dataTable utility functions.
*/
'columns' => [
/*
* List of columns hidden/removed on json response.
*/
'excess' => ['rn', 'row_num'],
/*
* List of columns to be escaped. If set to *, all columns are escape.
* Note: You can set the value to empty array to disable XSS protection.
*/
'escape' => '*',
/*
* List of columns that are allowed to display html content.
* Note: Adding columns to list will make us available to XSS attacks.
*/
'raw' => ['action'],
/*
* List of columns are forbidden from being searched/sorted.
*/
'blacklist' => ['password', 'remember_token'],
/*
* List of columns that are only allowed fo search/sort.
* If set to *, all columns are allowed.
*/
'whitelist' => '*',
],
/*
* JsonResponse header and options config.
*/
'json' => [
'header' => [],
'options' => 0,
],
/*
* Default condition to determine if a parameter is a callback or not.
* Callbacks needs to start by those terms, or they will be cast to string.
*/
'callback' => ['$', '$.', 'function'],
];

76
config/filesystems.php Normal file
View File

@ -0,0 +1,76 @@
<?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. Just store away!
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => 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,
],
],
/*
|--------------------------------------------------------------------------
| 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'),
],
];

54
config/hashing.php Normal file
View File

@ -0,0 +1,54 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => true,
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 65536,
'threads' => 1,
'time' => 4,
'verify' => true,
],
];

32
config/larapex-charts.php Normal file
View File

@ -0,0 +1,32 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Font Options
|--------------------------------------------------------------------------
|
| Here you may specify font family and font color.
|
*/
'font_family' => 'Open Sans, Arial, sans-serif',
'font_color' => '#373d3f',
/*
|--------------------------------------------------------------------------
| Default Colors for datasets
|--------------------------------------------------------------------------
|
| Here you may specify which hexadecimal colors below you wish
| to use as your default colors palette in that order.
|
*/
'colors' => [
'#008FFB', '#00E396', '#feb019', '#ff455f', '#775dd0', '#80effe',
'#0077B5', '#ff6384', '#c9cbcf', '#0057ff', '#00a9f4', '#2ccdc9', '#5e72e4'
]
];

131
config/logging.php Normal file
View File

@ -0,0 +1,131 @@
<?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 gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'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' => false,
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['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' => 14,
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'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,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'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'),
],
],
];

134
config/mail.php Normal file
View File

@ -0,0 +1,134 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| 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 to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
'ses' => [
'transport' => 'ses',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => null,
// 'client' => [
// 'timeout' => 5,
// ],
],
'mailgun' => [
'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
],
'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',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails 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 e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

109
config/queue.php Normal file
View File

@ -0,0 +1,109 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'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' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'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', 'mysql'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

83
config/sanctum.php Normal file
View File

@ -0,0 +1,83 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
],
];

34
config/services.php Normal file
View File

@ -0,0 +1,34 @@
<?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.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
'scheme' => 'https',
],
'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'),
],
];

214
config/session.php Normal file
View File

@ -0,0 +1,214 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| 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 immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'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 we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured 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 cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'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 are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'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. You are free to modify this option if needed.
|
*/
'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" since this is a secure default value.
|
| Supported: "lax", "strict", "none", null
|
*/
'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' => false,
];

36
config/view.php Normal file
View File

@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

1
database/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sqlite*

View File

@ -0,0 +1,49 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Faker\Factory as Faker;
/**
* @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
{
$faker = Faker::create();
$nik = $faker->numberBetween(1000000000000000, 9999999999999999);
return [
'nama' => $faker->name(),
'nik' => $nik,
'username' => $faker->userName(),
'password' => static::$password ??= Hash::make('password'),
'id_role' => 3,
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View 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('users', function (Blueprint $table) {
$table->id('id_users');
$table->string('nik')->unique();
$table->string('nama');
$table->string('username');
$table->string('password');
$table->string('no_telp')->nullable();
$table->string('alamat')->nullable();
$table->enum('jenis_kelamin', ['Laki-Laki', 'Perempuan'])->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};

View File

@ -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('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('password_reset_tokens');
}
};

View File

@ -0,0 +1,32 @@
<?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('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('failed_jobs');
}
};

View File

@ -0,0 +1,33 @@
<?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('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};

View File

@ -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('role', function (Blueprint $table) {
$table->id('id_role');
$table->string('nama_role', 20);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('role');
}
};

View 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('anggota', function (Blueprint $table) {
$table->id('id_anggota');
$table->string('nik')->unique();
$table->string('no_anggota')->unique();
$table->string('nama');
$table->enum('jenis_kelamin', ['Laki-Laki', 'Perempuan'])->nullable();
$table->string('alamat')->nullable();
$table->string('no_telp')->nullable();
$table->string('pekerjaan')->nullable();
$table->enum('jenis_anggota', ['Pendiri', 'Biasa'])->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('anggota');
}
};

View 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
{
Schema::create('simpanan', function (Blueprint $table) {
$table->id('id_simpanan');
$table->unsignedBigInteger('id_anggota')->required();
$table->foreign('id_anggota')->references('id_anggota')->on('anggota')->onDelete('cascade')->onUpdate('cascade');
$table->decimal('total_saldo', 10, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('simpanan');
}
};

View 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
{
Schema::table('users', function (Blueprint $table) {
$table->unsignedBigInteger('id_role');
$table->foreign('id_role')->references('id_role')->on('role');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropForeign('users_id_role_foreign');
$table->dropColumn('id_role');
});
}
};

View File

@ -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('detail_simpanan', function (Blueprint $table) {
$table->id('id');
$table->unsignedBigInteger('id_simpanan')->required();
$table->foreign('id_simpanan')->references('id_simpanan')->on('simpanan')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_users')->required();
$table->foreign('id_users')->references('id_users')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->enum('jenis_transaksi', ['Setor', 'Tarik']);
$table->decimal('simpanan_pokok', 10, 2)->nullable();
$table->decimal('simpanan_wajib', 10, 2)->nullable();
$table->decimal('simpanan_sukarela', 10, 2)->nullable();
$table->decimal('subtotal_saldo', 10, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('detail_simpanan');
}
};

View 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('pinjaman', function (Blueprint $table) {
$table->id('id_pinjaman');
$table->unsignedBigInteger('id_anggota')->required();
$table->foreign('id_anggota')->references('id_anggota')->on('anggota')->onDelete('cascade')->onUpdate('cascade');
$table->string('no_pinjaman');
$table->decimal('total_pinjaman', 10, 2);
$table->integer('angsuran');
$table->decimal('sisa_lancar_keseluruhan', 10, 2);
$table->enum('status_pinjaman', ['Belum Lunas', 'Lunas', 'Lewat Jatuh Tempo']);
$table->timestamp('tanggal_realisasi')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('pinjaman');
}
};

View File

@ -0,0 +1,38 @@
<?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('detail_pinjaman', function (Blueprint $table) {
$table->id('id');
$table->unsignedBigInteger('id_pinjaman')->required();
$table->foreign('id_pinjaman')->references('id_pinjaman')->on('pinjaman')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_users')->required();
$table->foreign('id_users')->references('id_users')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->integer('angsuran_ke_');
$table->decimal('angsuran_pokok', 10, 2);
$table->decimal('bunga', 10, 2);
$table->decimal('subtotal_angsuran', 10, 2);
$table->timestamp('tanggal_jatuh_tempo')->notNull()->useCurrent();
$table->enum('status_pelunasan', ['Belum Lunas', 'Lunas', 'Lewat Jatuh Tempo']);
$table->enum('keterangan', ['Tepat Waktu', 'Terlambat'])->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('detail_pinjaman');
}
};

View File

@ -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('history_transaksi', function (Blueprint $table) {
$table->unsignedBigInteger('id_users')->required();
$table->foreign('id_users')->references('id_users')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_anggota')->required();
$table->foreign('id_anggota')->references('id_anggota')->on('anggota')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_detail_simpanan')->nullable();
$table->foreign('id_detail_simpanan')->references('id')->on('detail_simpanan')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_pinjaman')->nullable();
$table->foreign('id_pinjaman')->references('id_pinjaman')->on('pinjaman')->onDelete('cascade')->onUpdate('cascade');
$table->unsignedBigInteger('id_detail_pinjaman')->nullable();
$table->foreign('id_detail_pinjaman')->references('id')->on('detail_pinjaman')->onDelete('cascade')->onUpdate('cascade');
$table->enum('tipe_transaksi', ['Pemasukan', 'Pengeluaran']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('history_transaksi');
}
};

View File

@ -0,0 +1,32 @@
<?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('laporan', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('id_detail_pinjaman')->nullable();
$table->foreign('id_detail_pinjaman')->references('id')->on('detail_pinjaman')->onDelete('cascade')->onUpdate('cascade');
$table->string('keterangan');
$table->enum('klasifikasi', ['Pendapatan', 'Beban Operasional']);
$table->decimal('jumlah_uang', 10, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('laporan');
}
};

View File

@ -0,0 +1,753 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use App\Models\Role;
use App\Models\Anggota;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;
class AnggotaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('anggota')->insert([
[
'id_anggota' => 7,
'nik' => '3574016104040001',
'no_anggota' => '18052024058648',
'nama' => 'Dwi Ariyanti',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 8',
'no_telp' => '089765678984',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:05:36',
'updated_at' => '2024-05-17 11:18:00'
],
[
'id_anggota' => 8,
'nik' => '3574016104040002',
'no_anggota' => '18052024499678',
'nama' => 'Setyowati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 9',
'no_telp' => '089765678988',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:10:26',
'updated_at' => '2024-05-17 11:17:38'
],
[
'id_anggota' => 9,
'nik' => '3574016104040003',
'no_anggota' => '18052024991765',
'nama' => 'Sri Ismaningsih',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Kopian',
'no_telp' => '089765678985',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:13:32',
'updated_at' => '2024-05-17 11:13:32'
],
[
'id_anggota' => 10,
'nik' => '3574016104040005',
'no_anggota' => '18052024242537',
'nama' => 'Tatik Indrawati Wibowo',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:14:59',
'updated_at' => '2024-05-17 11:17:12'
],
[
'id_anggota' => 11,
'nik' => '3574016104040006',
'no_anggota' => '18052024588424',
'nama' => 'Ahmad Hadi Nur Wibowo',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352708',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:16:44',
'updated_at' => '2024-05-17 11:16:44'
],
[
'id_anggota' => 12,
'nik' => '3574016104040007',
'no_anggota' => '18052024355411',
'nama' => 'Alfia Aziza',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu No 8',
'no_telp' => '085927352704',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:20:04',
'updated_at' => '2024-05-17 11:30:33'
],
[
'id_anggota' => 13,
'nik' => '3574016104040008',
'no_anggota' => '18052024058649',
'nama' => 'Ana Subaidah',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 1',
'no_telp' => '089765678987',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:05:36',
'updated_at' => '2024-05-17 04:18:00'
],
[
'id_anggota' => 14,
'nik' => '3574016104040009',
'no_anggota' => '18052024499679',
'nama' => 'Balis Prasmawati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Melati 9',
'no_telp' => '089765678688',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:10:26',
'updated_at' => '2024-05-17 04:17:38'
],
[
'id_anggota' => 15,
'nik' => '3574016104040010',
'no_anggota' => '18052024991766',
'nama' => 'Herlina Nanda Putri',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mastrip No 1',
'no_telp' => '089745678985',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:13:32',
'updated_at' => '2024-05-17 04:13:32'
],
[
'id_anggota' => 16,
'nik' => '3574016104040011',
'no_anggota' => '18052024242539',
'nama' => 'Hosnan Tiram',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 8',
'no_telp' => '085927152702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:14:59',
'updated_at' => '2024-05-17 04:17:12'
],
[
'id_anggota' => 17,
'nik' => '3574016104040012',
'no_anggota' => '18052024588420',
'nama' => 'Ishak',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Cokroaminoto No 7',
'no_telp' => '085927362708',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:16:44',
'updated_at' => '2024-05-17 04:16:44'
],
[
'id_anggota' => 18,
'nik' => '3574016104040013',
'no_anggota' => '18052024355412',
'nama' => 'Jumadi',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Cokroaminoto No 8',
'no_telp' => '085927362704',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:20:04',
'updated_at' => '2024-05-17 04:30:33'
],
[
'id_anggota' => 19,
'nik' => '3574016104040014',
'no_anggota' => '18052024058650',
'nama' => 'Kumis Subaidah',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 10',
'no_telp' => '089765678999',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:05:36',
'updated_at' => '2024-05-17 05:18:00'
],
[
'id_anggota' => 20,
'nik' => '3574016104040015',
'no_anggota' => '18052024499680',
'nama' => 'Kumolo Saputra',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Melati 10',
'no_telp' => '089765678999',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:10:26',
'updated_at' => '2024-05-17 05:17:38'
],
[
'id_anggota' => 21,
'nik' => '3574016104040016',
'no_anggota' => '18052024991767',
'nama' => 'Lukman',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 9',
'no_telp' => '089765678999',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:13:32',
'updated_at' => '2024-05-17 05:13:32'
],
[
'id_anggota' => 22,
'nik' => '3574016104040017',
'no_anggota' => '18052024242541',
'nama' => 'Mandala Tiram',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 10',
'no_telp' => '085927152710',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:14:59',
'updated_at' => '2024-05-17 05:17:12'
],
[
'id_anggota' => 23,
'nik' => '3574016104040018',
'no_anggota' => '18052024588422',
'nama' => 'Nuryati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Kenangan No 5',
'no_telp' => '085927362710',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:16:44',
'updated_at' => '2024-05-17 05:16:44'
],
[
'id_anggota' => 24,
'nik' => '3574016104040019',
'no_anggota' => '18052024355413',
'nama' => 'Oman',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Cokroaminoto No 9',
'no_telp' => '085927362706',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 05:20:04',
'updated_at' => '2024-05-17 05:30:33'
],
[
'id_anggota' => 25,
'nik' => '3574016104040020',
'no_anggota' => '18052024058651',
'nama' => 'Pradita',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 11',
'no_telp' => '089765679999',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:05:36',
'updated_at' => '2024-05-17 06:18:00'
],
[
'id_anggota' => 26,
'nik' => '3574016104040021',
'no_anggota' => '18052024499681',
'nama' => 'Rahmawati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Melati 11',
'no_telp' => '089765678988',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:10:26',
'updated_at' => '2024-05-17 06:17:38'
],
[
'id_anggota' => 27,
'nik' => '3574016104040022',
'no_anggota' => '18052024991768',
'nama' => 'Samsul Hadi',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 11',
'no_telp' => '089765678988',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:13:32',
'updated_at' => '2024-05-17 06:13:32'
],
[
'id_anggota' => 28,
'nik' => '3574016104040023',
'no_anggota' => '18052024242543',
'nama' => 'Sugeng Wijaya',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 12',
'no_telp' => '085927352702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:14:59',
'updated_at' => '2024-05-17 06:17:12'
],
[
'id_anggota' => 29,
'nik' => '3574016104040024',
'no_anggota' => '18052024588423',
'nama' => 'Susi Susanti',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Kenangan No 6',
'no_telp' => '085927352708',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-21',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:16:44',
'updated_at' => '2024-05-17 06:16:44'
],
[
'id_anggota' => 30,
'nik' => '3574016104040025',
'no_anggota' => '18052024355414',
'nama' => 'Tiara Permata',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Cokroaminoto No 10',
'no_telp' => '085927362704',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-22',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 06:20:04',
'updated_at' => '2024-05-17 06:30:33'
],
[
'id_anggota' => 31,
'nik' => '3574016104040028',
'no_anggota' => '18052024058319',
'nama' => 'Sunyoto',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 1',
'no_telp' => '089765674987',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:05:36',
'updated_at' => '2024-05-17 04:18:00',
],
[
'id_anggota' => 32,
'nik' => '3590401610401001',
'no_anggota' => '1805203058648',
'nama' => 'Sutarnal',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 8',
'no_telp' => '089765678984',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:05:36',
'updated_at' => '2024-05-17 11:18:00',
],
[
'id_anggota' => 33,
'nik' => '3574072610402002',
'no_anggota' => '180527499678',
'nama' => 'Sutin',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 9',
'no_telp' => '089765678988',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:10:26',
'updated_at' => '2024-05-17 11:17:38',
],
[
'id_anggota' => 34,
'nik' => '35740161040423',
'no_anggota' => '1805203991765',
'nama' => 'Ari Soesandi',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Kopian',
'no_telp' => '089765678985',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:13:32',
'updated_at' => '2024-05-17 11:13:32',
],
[
'id_anggota' => 35,
'nik' => '35740161040405',
'no_anggota' => '1805224242537',
'nama' => 'Lismnini',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:14:59',
'updated_at' => '2024-05-17 11:17:12',
],
[
'id_anggota' => 36,
'nik' => '35740161040446',
'no_anggota' => '1805214588424',
'nama' => 'Susilowati',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352708',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2019-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:16:44',
'updated_at' => '2024-05-17 11:16:44',
],
[
'id_anggota' => 40,
'nik' => '357401610404310',
'no_anggota' => '1805202491766',
'nama' => 'Slamet Sodiq',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 1',
'no_telp' => '089745678985',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:13:32',
'updated_at' => '2024-05-17 04:13:32',
],
[
'id_anggota' => 41,
'nik' => '357401610404711',
'no_anggota' => '1805202492539',
'nama' => 'Ikhromy Alif Viandra',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 8',
'no_telp' => '085927152702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:14:59',
'updated_at' => '2024-05-17 04:17:12',
],
[
'id_anggota' => 42,
'nik' => '357401610404282',
'no_anggota' => '18052024538420',
'nama' => 'Indra Budi Jaya',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Cokroaminoto No 7',
'no_telp' => '085927362708',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:16:44',
'updated_at' => '2024-05-17 04:16:44',
],
[
'id_anggota' => 43,
'nik' => '357401610404113',
'no_anggota' => '1805202432416',
'nama' => 'Felisa Sybila Enova',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Supriyadi No 2',
'no_telp' => '085927952704',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:20:04',
'updated_at' => '2024-05-17 04:30:33',
],
[
'id_anggota' => 44,
'nik' => '357401610404348',
'no_anggota' => '1805202401769',
'nama' => 'Umidatul Khoiro',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 1',
'no_telp' => '089795678987',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:05:36',
'updated_at' => '2024-05-17 04:18:00',
],
[
'id_anggota' => 45,
'nik' => '357401610404209',
'no_anggota' => '1805202442669',
'nama' => 'Widodo Budi Utomo',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Melati 9',
'no_telp' => '089765218688',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:10:26',
'updated_at' => '2024-05-17 04:17:38',
],
[
'id_anggota' => 46,
'nik' => '357401610414010',
'no_anggota' => '1805202490756',
'nama' => 'Tria Agus Priyanto',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 1',
'no_telp' => '089745674685',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:13:32',
'updated_at' => '2024-05-17 04:13:32',
],
[
'id_anggota' => 47,
'nik' => '3574016104030091',
'no_anggota' => '1805202432139',
'nama' => 'Audi Elvira Widiyanti',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mastrip No 8',
'no_telp' => '085917152702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:14:59',
'updated_at' => '2024-05-17 04:17:12',
],
[
'id_anggota' => 48,
'nik' => '3574016104047892',
'no_anggota' => '1805202418462',
'nama' => 'Bisma Aflah Widiyanto',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Cokroaminoto No 7',
'no_telp' => '085907362708',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:16:44',
'updated_at' => '2024-05-17 04:16:44',
],
[
'id_anggota' => 49,
'nik' => '3574016104011013',
'no_anggota' => '1805202425416',
'nama' => 'Viva Rosita',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Supriyadi No 2',
'no_telp' => '085927950704',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:20:04',
'updated_at' => '2024-05-17 04:30:33',
],
[
'id_anggota' => 50,
'nik' => '3574036104040088',
'no_anggota' => '1805202442699',
'nama' => 'Ummi Khaula',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Mawar 1',
'no_telp' => '089767678987',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:05:36',
'updated_at' => '2024-05-17 04:18:00',
],
[
'id_anggota' => 51,
'nik' => '3574016164041239',
'no_anggota' => '1805202474677',
'nama' => 'Tosi',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Melati 9',
'no_telp' => '089765678668',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-19',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 04:10:26',
'updated_at' => '2024-05-17 04:17:38',
],
[
'id_anggota' => 52,
'nik' => '3574016104040128',
'no_anggota' => '1805202469742',
'nama' => 'Farandi',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 1',
'no_telp' => '086745678985',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:13:32',
'updated_at' => '2024-05-17 04:13:32',
],
[
'id_anggota' => 53,
'nik' => '3574012104040071',
'no_anggota' => '1805202439039',
'nama' => 'Gandhi Mens Hastadi',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mastrip No 8',
'no_telp' => '081927152702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:14:59',
'updated_at' => '2024-05-17 04:17:12',
],
[
'id_anggota' => 54,
'nik' => '3574016105041212',
'no_anggota' => '1805202428489',
'nama' => 'Risnanda Hermawati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Cokroaminoto No 7',
'no_telp' => '085947362708',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:16:44',
'updated_at' => '2024-05-17 04:16:44',
],
[
'id_anggota' => 55,
'nik' => '3574016132040055',
'no_anggota' => '1805202405416',
'nama' => 'Shella',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Supriyadi No 2',
'no_telp' => '085927252704',
'pekerjaan' => 'Swasta',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:20:04',
'updated_at' => '2024-05-17 04:30:33',
],
[
'id_anggota' => 56,
'nik' => '3574016104041028',
'no_anggota' => '1805202401319',
'nama' => 'Safwan Iqbal Risqullah',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 1',
'no_telp' => '089765674987',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-20',
'jenis_anggota' => 'Biasa',
'created_at' => '2024-05-17 04:05:36',
'updated_at' => '2024-05-17 04:18:00',
],
[
'id_anggota' => 57,
'nik' => '3574072619402002',
'no_anggota' => '180527123678',
'nama' => 'Fahrio Dwi Cahyo',
'jenis_kelamin' => 'Laki-Laki',
'alamat' => 'Jl Mawar 9',
'no_telp' => '089765678988',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:10:26',
'updated_at' => '2024-05-17 11:17:38',
],
[
'id_anggota' => 58,
'nik' => '35740161020423',
'no_anggota' => '1805203931765',
'nama' => 'Diana Noerawati',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Kopian',
'no_telp' => '089765678985',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:13:32',
'updated_at' => '2024-05-17 11:13:32',
],
[
'id_anggota' => 59,
'nik' => '35740161010405',
'no_anggota' => '1805224642537',
'nama' => 'Chotima',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352702',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:14:59',
'updated_at' => '2024-05-17 11:17:12',
],
[
'id_anggota' => 60,
'nik' => '35740161080446',
'no_anggota' => '1805214088424',
'nama' => 'Sabarina',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352708',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:16:44',
'updated_at' => '2024-05-17 11:16:44',
],
[
'id_anggota' => 61,
'nik' => '35740161060446',
'no_anggota' => '1805214688424',
'nama' => 'Wiwin',
'jenis_kelamin' => 'Perempuan',
'alamat' => 'Jl Tangkuban Perahu',
'no_telp' => '085927352708',
'pekerjaan' => 'Pegawai',
'tanggal_masuk' => '2022-05-18',
'jenis_anggota' => 'Pendiri',
'created_at' => '2024-05-17 11:16:44',
'updated_at' => '2024-05-17 11:16:44',
],
]);
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\Role;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
Schema::disableForeignKeyConstraints();
Role::truncate();
Schema::enableForeignKeyConstraints();
$data = [
'Admin', 'Pengurus', 'Pegawai'
];
foreach ($data as $value) {
Role::insert([
'nama_role' => $value
]);
}
User::factory()->create([
'nama' => 'Admin',
'username' => 'admin',
'password' => Hash::make('admin123'),
'id_role' => 1,
]);
}
}

988
package-lock.json generated Normal file
View File

@ -0,0 +1,988 @@
{
"name": "koperasiwebapp",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"chart.js": "^4.4.2",
"datatables.net-bs4": "^2.0.3",
"datatables.net-buttons": "^3.0.2",
"datatables.net-buttons-bs4": "^3.0.2"
},
"devDependencies": {
"axios": "^1.6.4",
"laravel-vite-plugin": "^1.0.0",
"vite": "^5.0.0"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
"integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz",
"integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz",
"integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz",
"integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz",
"integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
"integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz",
"integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz",
"integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz",
"integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz",
"integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz",
"integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz",
"integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==",
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz",
"integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz",
"integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz",
"integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz",
"integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz",
"integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz",
"integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz",
"integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz",
"integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz",
"integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz",
"integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz",
"integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@kurkle/color": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.1.tgz",
"integrity": "sha512-fH8/o8nSUek8ceQnT7K4EQbSiV7jgkHq81m9lWZFIXjJ7lJzpWXbQFpT/Zh6OZYnpFykvzC3fbEvEAFZu03dPA==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.1.tgz",
"integrity": "sha512-Y/9OHLjzkunF+KGEoJr3heiD5X9OLa8sbT1lm0NYeKyaM3oMhhQFvPB0bNZYJwlq93j8Z6wSxh9+cyKQaxS7PQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.1.tgz",
"integrity": "sha512-+kecg3FY84WadgcuSVm6llrABOdQAEbNdnpi5X3UwWiFVhZIZvKgGrF7kmLguvxHNQy+UuRV66cLVl3S+Rkt+Q==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.1.tgz",
"integrity": "sha512-2pYRzEjVqq2TB/UNv47BV/8vQiXkFGVmPFwJb+1E0IFFZbIX8/jo1olxqqMbo6xCXf8kabANhp5bzCij2tFLUA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.1.tgz",
"integrity": "sha512-mS6wQ6Do6/wmrF9aTFVpIJ3/IDXhg1EZcQFYHZLHqw6AzMBjTHWnCG35HxSqUNphh0EHqSM6wRTT8HsL1C0x5g==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.1.tgz",
"integrity": "sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.1.tgz",
"integrity": "sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.1.tgz",
"integrity": "sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==",
"cpu": [
"ppc64le"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.1.tgz",
"integrity": "sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.1.tgz",
"integrity": "sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.1.tgz",
"integrity": "sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.1.tgz",
"integrity": "sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.1.tgz",
"integrity": "sha512-ryS22I9y0mumlLNwDFYZRDFLwWh3aKaC72CWjFcFvxK0U6v/mOkM5Up1bTbCRAhv3kEIwW2ajROegCIQViUCeA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.1.tgz",
"integrity": "sha512-TdloItiGk+T0mTxKx7Hp279xy30LspMso+GzQvV2maYePMAWdmrzqSNZhUpPj3CGw12aGj57I026PgLCTu8CGg==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.1.tgz",
"integrity": "sha512-wQGI+LY/Py20zdUPq+XCem7JcPOyzIJBm3dli+56DJsQOHbnXZFEwgmnC6el1TPAfC8lBT3m+z69RmLykNUbew==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
]
},
"node_modules/@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
"dev": true
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
"node_modules/axios": {
"version": "1.6.8",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/chart.js": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.2.tgz",
"integrity": "sha512-6GD7iKwFpP5kbSD4MeRRRlTnQvxfQREy36uEtm1hzHzcOqwWx0YEHuspuoNlslu+nciLIB7fjjsHkUv/FzFcOg==",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": ">=8"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/datatables.net": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.0.3.tgz",
"integrity": "sha512-phq7jhkjIlVdahZYa2nd/yeiDgFrvT++Sily3GgztG3T7qqdAWkjtLuGA2Pv5p7XBwkJ0zwf+0KDRU54uR7WAg==",
"dependencies": {
"jquery": ">=1.7"
}
},
"node_modules/datatables.net-bs4": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/datatables.net-bs4/-/datatables.net-bs4-2.0.3.tgz",
"integrity": "sha512-KNby8CXJMUWujmlVo+QyhtDnAGOcXYEV9/FKs6rwXNn6z0EU6RAbqKF0gyyss0nFxjtlJPb36pssEYFJGY+Ttw==",
"dependencies": {
"datatables.net": "2.0.3",
"jquery": ">=1.7"
}
},
"node_modules/datatables.net-buttons": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/datatables.net-buttons/-/datatables.net-buttons-3.0.2.tgz",
"integrity": "sha512-J+vk4hLtTivnl+RxzpKPE7CG4ggdgHPQcHnpqViy9w6ia18Uh69dQktX6NJ87QrqNPCTMUyHDzUzsRFURG4/Fw==",
"dependencies": {
"datatables.net": "^2",
"jquery": ">=1.7"
}
},
"node_modules/datatables.net-buttons-bs4": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/datatables.net-buttons-bs4/-/datatables.net-buttons-bs4-3.0.2.tgz",
"integrity": "sha512-B3xzrab0rpZUgyXUQEdPJP/Vru9clHKFE/bUliKevXlHdFvRTCBbuSdVQrTTAbOTPUMaHvpn3aqA7Vcu35CxWQ==",
"dependencies": {
"datatables.net-bs4": "^2",
"datatables.net-buttons": "3.0.2",
"jquery": ">=1.7"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/esbuild": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
"integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.20.2",
"@esbuild/android-arm": "0.20.2",
"@esbuild/android-arm64": "0.20.2",
"@esbuild/android-x64": "0.20.2",
"@esbuild/darwin-arm64": "0.20.2",
"@esbuild/darwin-x64": "0.20.2",
"@esbuild/freebsd-arm64": "0.20.2",
"@esbuild/freebsd-x64": "0.20.2",
"@esbuild/linux-arm": "0.20.2",
"@esbuild/linux-arm64": "0.20.2",
"@esbuild/linux-ia32": "0.20.2",
"@esbuild/linux-loong64": "0.20.2",
"@esbuild/linux-mips64el": "0.20.2",
"@esbuild/linux-ppc64": "0.20.2",
"@esbuild/linux-riscv64": "0.20.2",
"@esbuild/linux-s390x": "0.20.2",
"@esbuild/linux-x64": "0.20.2",
"@esbuild/netbsd-x64": "0.20.2",
"@esbuild/openbsd-x64": "0.20.2",
"@esbuild/sunos-x64": "0.20.2",
"@esbuild/win32-arm64": "0.20.2",
"@esbuild/win32-ia32": "0.20.2",
"@esbuild/win32-x64": "0.20.2"
}
},
"node_modules/follow-redirects": {
"version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/laravel-vite-plugin": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.0.2.tgz",
"integrity": "sha512-Mcclml10khYzBVxDwJro8wnVDwD4i7XOSEMACQNnarvTnHjrjXLLL+B/Snif2wYAyElsOqagJZ7VAinb/2vF5g==",
"dev": true,
"dependencies": {
"picocolors": "^1.0.0",
"vite-plugin-full-reload": "^1.1.0"
},
"bin": {
"clean-orphaned-assets": "bin/clean.js"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true,
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/postcss": {
"version": "8.4.38",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
"integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.0.0",
"source-map-js": "^1.2.0"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true
},
"node_modules/rollup": {
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.1.tgz",
"integrity": "sha512-4LnHSdd3QK2pa1J6dFbfm1HN0D7vSK/ZuZTsdyUAlA6Rr1yTouUTL13HaDOGJVgby461AhrNGBS7sCGXXtT+SA==",
"dev": true,
"dependencies": {
"@types/estree": "1.0.5"
},
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.14.1",
"@rollup/rollup-android-arm64": "4.14.1",
"@rollup/rollup-darwin-arm64": "4.14.1",
"@rollup/rollup-darwin-x64": "4.14.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.14.1",
"@rollup/rollup-linux-arm64-gnu": "4.14.1",
"@rollup/rollup-linux-arm64-musl": "4.14.1",
"@rollup/rollup-linux-powerpc64le-gnu": "4.14.1",
"@rollup/rollup-linux-riscv64-gnu": "4.14.1",
"@rollup/rollup-linux-s390x-gnu": "4.14.1",
"@rollup/rollup-linux-x64-gnu": "4.14.1",
"@rollup/rollup-linux-x64-musl": "4.14.1",
"@rollup/rollup-win32-arm64-msvc": "4.14.1",
"@rollup/rollup-win32-ia32-msvc": "4.14.1",
"@rollup/rollup-win32-x64-msvc": "4.14.1",
"fsevents": "~2.3.2"
}
},
"node_modules/source-map-js": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vite": {
"version": "5.2.8",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.2.8.tgz",
"integrity": "sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==",
"dev": true,
"dependencies": {
"esbuild": "^0.20.1",
"postcss": "^8.4.38",
"rollup": "^4.13.0"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"peerDependencies": {
"@types/node": "^18.0.0 || >=20.0.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.4.0"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
}
}
},
"node_modules/vite-plugin-full-reload": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.1.0.tgz",
"integrity": "sha512-3cObNDzX6DdfhD9E7kf6w2mNunFpD7drxyNgHLw+XwIYAgb+Xt16SEXo0Up4VH+TMf3n+DSVJZtW2POBGcBYAA==",
"dev": true,
"dependencies": {
"picocolors": "^1.0.0",
"picomatch": "^2.3.1"
}
}
}
}

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.6.4",
"laravel-vite-plugin": "^1.0.0",
"vite": "^5.0.0"
},
"dependencies": {
"chart.js": "^4.4.2",
"datatables.net-bs4": "^2.0.3",
"datatables.net-buttons": "^3.0.2",
"datatables.net-buttons-bs4": "^3.0.2"
}
}

32
phpunit.xml Normal file
View File

@ -0,0 +1,32 @@
<?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="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" 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>

21
public/.htaccess Normal file
View File

@ -0,0 +1,21 @@
<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}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

0
public/favicon.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Some files were not shown because too many files have changed in this diff Show More