first commit

This commit is contained in:
Agnesia17 2025-07-11 10:41:38 +07:00
commit e488734992
2044 changed files with 211289 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

66
.env.example Normal file
View File

@ -0,0 +1,66 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"

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

23
.gitignore vendored Normal file
View File

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

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 thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[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,87 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Maatwebsite\Excel\Events\AfterSheet;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class LaporanKeuanganExport implements FromCollection, WithHeadings, WithMapping, WithEvents, WithColumnFormatting
{
protected $laporanKeuangan;
private $rowNumber = 0;
public function __construct($laporanKeuangan)
{
$this->laporanKeuangan = $laporanKeuangan;
}
public function collection()
{
return $this->laporanKeuangan;
}
public function headings(): array
{
return ['No', 'Tanggal', 'Debit', 'Kredit'];
}
public function map($row): array
{
$this->rowNumber++;
return [
$this->rowNumber,
$row['tanggal'],
$row['pemasukan'],
$row['pengeluaran']
];
}
public function columnFormats(): array
{
return [
'B' => NumberFormat::FORMAT_DATE_YYYYMMDD,
'C' => '#,##0',
'D' => '#,##0',
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$lastRow = $this->rowNumber + 1;
// Style header
$event->sheet->getStyle("A1:D1")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => 'E2EFDA']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Style isi tabel
$event->sheet->getStyle("A2:D{$lastRow}")->applyFromArray([
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
$event->sheet->getColumnDimension('B')->setWidth(15);
$event->sheet->getColumnDimension('C')->setWidth(25); // Kolom Pemasukan
$event->sheet->getColumnDimension('D')->setWidth(25); // Kolom Pengeluaran
}
];
}
}

View File

@ -0,0 +1,144 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\AfterSheet;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
class LaporanLabaExport implements FromCollection, WithHeadings, WithMapping, WithEvents, WithColumnFormatting
{
protected $laporanLaba;
protected $totalLabaKeseluruhan;
private $rowNumber = 0;
public function __construct($laporanLaba, $totalLabaKeseluruhan)
{
$this->laporanLaba = $laporanLaba;
$this->totalLabaKeseluruhan = $totalLabaKeseluruhan;
}
public function collection()
{
return $this->laporanLaba;
}
public function headings(): array
{
return [
'No',
'Tanggal',
'Nama Produk',
'Harga Beli',
'Harga Jual',
'Jumlah/Kg',
'Laba Bersih',
];
}
public function map($laba): array
{
$this->rowNumber++;
return [
$this->rowNumber,
$laba->tanggal,
$laba->nama_produk,
$laba->product->harga_beli ?? 0,
$laba->harga_jual,
$laba->jumlah,
($laba->harga_jual - ($laba->product->harga_beli ?? 0)) * $laba->jumlah,
];
}
public function columnFormats(): array
{
return [
'B' => NumberFormat::FORMAT_DATE_DDMMYYYY,
'D' => '#,##0',
'E' => '#,##0',
'F' => '#,##0.00',
'G' => '#,##0',
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$sheet = $event->sheet;
$lastRow = $this->rowNumber + 1;
$lastColumn = 'G';
// Set kolom width
$sheet->getColumnDimension('A')->setWidth(5); // No
$sheet->getColumnDimension('B')->setWidth(15); // Tanggal
$sheet->getColumnDimension('C')->setWidth(25); // Nama Produk
$sheet->getColumnDimension('D')->setWidth(15); // Harga Beli
$sheet->getColumnDimension('E')->setWidth(15); // Harga Jual
$sheet->getColumnDimension('F')->setWidth(12); // Jumlah/Kg
$sheet->getColumnDimension('G')->setWidth(15); // Laba Bersih
// Style untuk header
$sheet->getStyle("A1:{$lastColumn}1")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => 'E2EFDA']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Style untuk konten tabel
$sheet->getStyle("A2:{$lastColumn}{$lastRow}")->applyFromArray([
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Tambahkan total laba keseluruhan
$totalRow = $lastRow + 1;
$sheet->setCellValue("A{$totalRow}", "Total Laba Keseluruhan");
$sheet->mergeCells("A{$totalRow}:F{$totalRow}");
$sheet->setCellValue("G{$totalRow}", $this->totalLabaKeseluruhan);
// Style untuk baris total
$sheet->getStyle("A{$totalRow}:G{$totalRow}")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => '9BC2E6']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Set alignment
$sheet->getStyle("A1:G{$totalRow}")->getAlignment()->setVertical('center');
$sheet->getStyle("A1:A{$lastRow}")->getAlignment()->setHorizontal('center'); // No
$sheet->getStyle("B1:B{$lastRow}")->getAlignment()->setHorizontal('center'); // Tanggal
$sheet->getStyle("C1:C{$lastRow}")->getAlignment()->setHorizontal('left'); // Nama Produk
$sheet->getStyle("D1:G{$lastRow}")->getAlignment()->setHorizontal('right'); // Angka-angka
$sheet->getStyle("A{$totalRow}")->getAlignment()->setHorizontal('left'); // Label Total
$sheet->getStyle("G{$totalRow}")->getAlignment()->setHorizontal('right'); // Nilai Total
// Format currency untuk kolom harga dan laba
$currencyFormat = '#,##0';
$sheet->getStyle("D2:E{$lastRow}")->getNumberFormat()->setFormatCode($currencyFormat);
$sheet->getStyle("G2:G{$totalRow}")->getNumberFormat()->setFormatCode($currencyFormat);
}
];
}
}

View File

@ -0,0 +1,143 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\AfterSheet;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
class LaporanPembelianExport implements FromCollection, WithHeadings, WithMapping, WithEvents, WithColumnFormatting
{
protected $laporanPembelian;
protected $totalPembelian;
private $rowNumber = 0;
public function __construct($laporanPembelian, $totalPembelian)
{
$this->laporanPembelian = $laporanPembelian;
$this->totalPembelian = $totalPembelian;
}
public function collection()
{
return $this->laporanPembelian;
}
public function headings(): array
{
return [
'No',
'Tanggal',
'Nama Supplier',
'Nama Produk',
'Harga Beli',
'Jumlah/Kg',
'Total',
];
}
public function map($pembelian): array
{
$this->rowNumber++;
return [
$this->rowNumber,
$pembelian->tanggal,
$pembelian->nama_supplier,
$pembelian->nama_produk,
$pembelian->harga_beli,
$pembelian->jumlah,
$pembelian->total,
];
}
public function columnFormats(): array
{
return [
'B' => NumberFormat::FORMAT_DATE_DDMMYYYY,
'E' => '#,##0',
'F' => '#,##0.00',
'G' => '#,##0',
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$sheet = $event->sheet;
$lastRow = $this->rowNumber + 1;
$lastColumn = 'G';
// Set kolom width
$sheet->getColumnDimension('A')->setWidth(5); // No
$sheet->getColumnDimension('B')->setWidth(15); // Tanggal
$sheet->getColumnDimension('C')->setWidth(25); // Nama Supplier
$sheet->getColumnDimension('D')->setWidth(25); // Nama Produk
$sheet->getColumnDimension('E')->setWidth(15); // Harga Beli
$sheet->getColumnDimension('F')->setWidth(12); // Jumlah/Kg
$sheet->getColumnDimension('G')->setWidth(15); // Total
// Style untuk header
$sheet->getStyle("A1:{$lastColumn}1")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => 'E2EFDA']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Style untuk konten tabel
$sheet->getStyle("A2:{$lastColumn}{$lastRow}")->applyFromArray([
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Tambahkan total pembelian
$totalRow = $lastRow + 1;
$sheet->setCellValue("A{$totalRow}", "Total Pembelian");
$sheet->mergeCells("A{$totalRow}:F{$totalRow}");
$sheet->setCellValue("G{$totalRow}", $this->totalPembelian);
// Style untuk baris total
$sheet->getStyle("A{$totalRow}:G{$totalRow}")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => '9BC2E6']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Set alignment
$sheet->getStyle("A1:G{$totalRow}")->getAlignment()->setVertical('center');
$sheet->getStyle("A1:A{$lastRow}")->getAlignment()->setHorizontal('center'); // No
$sheet->getStyle("B1:B{$lastRow}")->getAlignment()->setHorizontal('center'); // Tanggal
$sheet->getStyle("C1:D{$lastRow}")->getAlignment()->setHorizontal('left'); // Nama Supplier & Produk
$sheet->getStyle("E1:G{$lastRow}")->getAlignment()->setHorizontal('right'); // Angka-angka
$sheet->getStyle("A{$totalRow}")->getAlignment()->setHorizontal('left'); // Label Total
$sheet->getStyle("G{$totalRow}")->getAlignment()->setHorizontal('right'); // Nilai Total
// Format currency untuk kolom harga dan total
$currencyFormat = '#,##0';
$sheet->getStyle("E2:E{$lastRow}")->getNumberFormat()->setFormatCode($currencyFormat);
$sheet->getStyle("G2:G{$totalRow}")->getNumberFormat()->setFormatCode($currencyFormat);
}
];
}
}

View File

@ -0,0 +1,143 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\AfterSheet;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
class LaporanPenjualanExport implements FromCollection, WithHeadings, WithMapping, WithEvents, WithColumnFormatting
{
protected $laporanPenjualan;
protected $totalPenjualan;
private $rowNumber = 0;
public function __construct($laporanPenjualan, $totalPenjualan)
{
$this->laporanPenjualan = $laporanPenjualan;
$this->totalPenjualan = $totalPenjualan;
}
public function collection()
{
return $this->laporanPenjualan;
}
public function headings(): array
{
return [
'No',
'Tanggal',
'Nama Pembeli',
'Nama Produk',
'Harga Jual',
'Jumlah/Kg',
'Total',
];
}
public function map($penjualan): array
{
$this->rowNumber++;
return [
$this->rowNumber,
$penjualan->tanggal,
$penjualan->nama_pembeli,
$penjualan->nama_produk,
$penjualan->harga_jual,
$penjualan->jumlah,
$penjualan->total,
];
}
public function columnFormats(): array
{
return [
'B' => NumberFormat::FORMAT_DATE_DDMMYYYY,
'E' => '#,##0',
'F' => '#,##0.00',
'G' => '#,##0',
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$sheet = $event->sheet;
$lastRow = $this->rowNumber + 1;
$lastColumn = 'G';
// Set kolom width
$sheet->getColumnDimension('A')->setWidth(5); // No
$sheet->getColumnDimension('B')->setWidth(15); // Tanggal
$sheet->getColumnDimension('C')->setWidth(25); // Nama Pembeli
$sheet->getColumnDimension('D')->setWidth(25); // Nama Produk
$sheet->getColumnDimension('E')->setWidth(15); // Harga Jual
$sheet->getColumnDimension('F')->setWidth(12); // Jumlah/Kg
$sheet->getColumnDimension('G')->setWidth(15); // Total
// Style untuk header
$sheet->getStyle("A1:{$lastColumn}1")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => 'E2EFDA']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Style untuk konten tabel
$sheet->getStyle("A2:{$lastColumn}{$lastRow}")->applyFromArray([
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Tambahkan total penjualan
$totalRow = $lastRow + 1;
$sheet->setCellValue("A{$totalRow}", "Total Penjualan");
$sheet->mergeCells("A{$totalRow}:F{$totalRow}");
$sheet->setCellValue("G{$totalRow}", $this->totalPenjualan);
// Style untuk baris total
$sheet->getStyle("A{$totalRow}:G{$totalRow}")->applyFromArray([
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'startColor' => ['rgb' => '9BC2E6']
],
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN
]
]
]);
// Set alignment
$sheet->getStyle("A1:G{$totalRow}")->getAlignment()->setVertical('center');
$sheet->getStyle("A1:A{$lastRow}")->getAlignment()->setHorizontal('center'); // No
$sheet->getStyle("B1:B{$lastRow}")->getAlignment()->setHorizontal('center'); // Tanggal
$sheet->getStyle("C1:D{$lastRow}")->getAlignment()->setHorizontal('left'); // Nama Pembeli & Produk
$sheet->getStyle("E1:G{$lastRow}")->getAlignment()->setHorizontal('right'); // Angka-angka
$sheet->getStyle("A{$totalRow}")->getAlignment()->setHorizontal('left'); // Label Total
$sheet->getStyle("G{$totalRow}")->getAlignment()->setHorizontal('right'); // Nilai Total
// Format currency untuk kolom harga dan total
$currencyFormat = '#,##0';
$sheet->getStyle("E2:E{$lastRow}")->getNumberFormat()->setFormatCode($currencyFormat);
$sheet->getStyle("G2:G{$totalRow}")->getNumberFormat()->setFormatCode($currencyFormat);
}
];
}
}

View File

@ -0,0 +1,179 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Support\Facades\Validator;
class AuthController extends Controller
{
# menampilkan halaman login
public function showLogin()
{
return view('admin.login');
}
# menampilkan halaman register
public function showRegister()
{
return view('admin.register');
}
# menampilkan halaman lupa password
public function showForgetPassword()
{
return view('auth.forget-password');
}
# menampilkan halaman reset password dengan data token berdasarkan email user
public function showResetPassword(Request $request, $token)
{
return view('auth.reset-password', ['token' => $token, 'email' => $request->email]);
}
# mengirim url link untuk reset password
public function sendResetLink(Request $request)
{
# validasi email apakah sesuai
$request->validate(['email' => 'required|email']);
# mengirim url reset link password
$status = Password::sendResetLink(
$request->only('email')
);
# jika sukses route ke menu reset password
return $status === Password::RESET_LINK_SENT
? view('auth.password-email')->with(['status' => __($status)])
: back()->withErrors(['email' => __($status)]);
}
# fungsi untuk reset password
public function resetPassword(Request $request)
{
# validasi apakah data yang diperlukan sesuai
$request->validate([
'token' => 'required',
'email' => 'required|email',
'password' => 'required|min:8|confirmed',
]);
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function ($user, $password) {
$user->forceFill([
'password' => Hash::make($password)
])->setRememberToken(Str::random(60));
$user->save();
event(new PasswordReset($user));
}
);
if ($status === Password::PASSWORD_RESET) {
// Ambil user dan pastikan mereka tetap harus verifikasi email sebelum login
$user = User::where('email', $request->email)->first();
if ($user && $user->email_verified_at === null) {
// Kirim ulang email verifikasi
$user->sendEmailVerificationNotification();
// Login user setelah register
Auth::login($user);
// Redirect ke halaman verifikasi
return redirect()->route('verification.notice')
->with('success', 'Silakan Periksa Email untuk verifikasi akun, supaya dapat segera digunakan');
}
return redirect()->route('login')->with('success', 'Password berhasil direset. Silakan login dengan password baru Anda.');
}
# kembali ke menu sebelumnya karena error
return back()->withErrors(['email' => __($status)]);
}
// fungsi untuk login
public function login(Request $request)
{
// cek apakah data yang dimasukkan sesuai
$credentials = $request->validate([
'email' => 'required|email',
'password' => 'required'
]);
// jika data akun yang dimasukan benar maka data user ditemukan
if (Auth::attempt($credentials, $request->has('remember'))) {
// membuat autentikasi user dan generate session
$user = Auth::user();
$request->session()->regenerate();
// jika email user belum terverifikasi maka kirim email
if ($user->email_verified_at === null) {
Auth::logout();
$user->sendEmailVerificationNotification();
// Login user setelah register
Auth::login($user);
// Redirect ke halaman verifikasi
return redirect()->route('verification.notice')
->with('success', 'Silakan Periksa Email untuk verifikasi akun, supaya dapat segera digunakan');
}
// jika sudah maka diarahkan ke halaman dashbord
return redirect()->intended('/dashboard');
}
// jika gagal tetap dihalaman login
return back()->withErrors([
'email' => 'Email atau password yang dimasukkan tidak valid.',
])->withInput($request->except('password'));
}
// fungsi untuk register
public function register(Request $request)
{
$validator = Validator::make($request->all(), [
'firstName' => 'required|string|max:255',
'lastName' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users,email',
'password' => 'required|string|min:6|confirmed',
], [
'email.unique' => 'Email ini sudah terdaftar. Silakan gunakan email lain.',
'password.confirmed' => 'Konfirmasi password tidak sesuai.',
]);
if ($validator->fails()) {
return back()->withErrors($validator)->withInput();
}
// Debugging untuk melihat input yang diterima
$fullName = trim($request->firstName) . ' ' . trim($request->lastName);
$user = User::create([
'name' => $fullName,
'email' => $request->email,
'password' => Hash::make($request->password),
]);
if (!$user) {
return back()->with('error', 'Gagal menyimpan data. Silakan coba lagi.');
}
// Kirim email verifikasi
$user->sendEmailVerificationNotification();
// Login user setelah register
Auth::login($user);
// Redirect ke halaman verifikasi
return redirect()->route('verification.notice')
->with('success', 'Registrasi berhasil! Silakan cek email Anda untuk verifikasi akun. Setelah verifikasi, Anda akan dapat login ke sistem.');
}
// fungsi untun logout
public function logout(Request $request)
{
// AUTENTIKASI DATA DIHAPUS dan session dihapus kemudian menuju halaman login
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/login');
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}

View File

@ -0,0 +1,91 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\LaporanPembelian;
use App\Models\LaporanPenjualan;
use App\Http\Controllers\Controller;
class DashboardController extends Controller
{
// menampilkan halaman awal ketika menuju halaman dashboard
public function index()
{
// Menghitung total barang masuk hari ini
$totalBarangMasuk = LaporanPembelian::whereDate('tanggal', today())
->sum('jumlah');
// Menghitung detail barang masuk per produk
$detailBarangMasuk = LaporanPembelian::whereDate('tanggal', today())
->selectRaw('nama_produk, SUM(jumlah) as total_jumlah')
->groupBy('nama_produk')
->get();
// Menghitung total barang keluar hari ini
$totalBarangKeluar = LaporanPenjualan::whereDate('tanggal', today())
->sum('jumlah');
// Menghitung detail barang keluar per produk
$detailBarangKeluar = LaporanPenjualan::whereDate('tanggal', today())
->selectRaw('nama_produk, SUM(jumlah) as total_jumlah')
->groupBy('nama_produk')
->get();
// Total pembelian dalam Rupiah
$totalPembelian = LaporanPembelian::whereDate('tanggal', today())
->sum('total');
// Total penjualan dalam Rupiah
$totalPenjualan = LaporanPenjualan::whereDate('tanggal', today())
->sum('total');
// menampilkan view dashboard dengan membawah data
return view('admin.dashboard', compact(
'totalBarangMasuk',
'detailBarangMasuk',
'totalBarangKeluar',
'detailBarangKeluar',
'totalPembelian',
'totalPenjualan'
));
}
// fungsi untuk convert data laporan penjualan dan pembelian ke dalam chart
public function getChartData(Request $request)
{
// mendapatkan data taun sekarang
$year = $request->year ?? date('Y');
$type = $request->type ?? 'both'; // default to showing both
// query untuk mendapatkan data laporan penjualan yang ditotal perbulannya
$penjualan = LaporanPenjualan::selectRaw('MONTH(tanggal) as month, SUM(total) as total')
->whereYear('tanggal', $year)
->groupBy('month')
->orderBy('month')
->get()
->pluck('total', 'month')
->toArray();
// query untuk mendapatkan data laporan pembelian yang ditotal perbulannya
$pembelian = LaporanPembelian::selectRaw('MONTH(tanggal) as month, SUM(total) as total')
->whereYear('tanggal', $year)
->groupBy('month')
->orderBy('month')
->get()
->pluck('total', 'month')
->toArray();
// jia data kosong maka diisi list kosong
$chartData = [
'penjualan' => [],
'pembelian' => []
];
// jika tidak maka data diakumulasikan
for ($i = 1; $i <= 12; $i++) {
$chartData['penjualan'][$i] = $penjualan[$i] ?? 0;
$chartData['pembelian'][$i] = $pembelian[$i] ?? 0;
}
// membawah data chart yang disimpan di JSON
return response()->json($chartData);
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\LaporanPembelian;
use App\Models\LaporanPenjualan;
use App\Http\Controllers\Controller;
use Illuminate\Support\Collection;
use Illuminate\Pagination\Paginator;
use Illuminate\Pagination\LengthAwarePaginator;
use App\Exports\LaporanKeuanganExport;
use Maatwebsite\Excel\Facades\Excel;
class LaporanKeuanganController extends Controller
{
//
public function index(Request $request)
{
// tahapan filter data
$startDate = $request->start_date;
$endDate = $request->end_date;
$month = $request->month;
$year = $request->year;
// Mendapatkan data laporan penjualan dan pembelian
$pembelianQuery = LaporanPembelian::query();
$penjualanQuery = LaporanPenjualan::query();
$isFilterActive = false;
if ($startDate && $endDate) {
// Data yang difilter berdasarkan tanggal awal dan tanggal akhir
$pembelianQuery->whereBetween('tanggal', [$startDate, $endDate]);
$penjualanQuery->whereBetween('tanggal', [$startDate, $endDate]);
$isFilterActive = true;
} elseif ($month && $year) {
// Data yang difilter berdasarkan bulan dan tahun
$pembelianQuery->whereMonth('tanggal', $month)->whereYear('tanggal', $year);
$penjualanQuery->whereMonth('tanggal', $month)->whereYear('tanggal', $year);
$isFilterActive = true;
}
// Filter untuk menampilkan data
$pengeluaran = $pembelianQuery->selectRaw('tanggal, SUM(total) as total')
->groupBy('tanggal')->get()->keyBy('tanggal');
$pemasukan = $penjualanQuery->selectRaw('tanggal, SUM(total) as total')
->groupBy('tanggal')->get()->keyBy('tanggal');
$allDates = $pemasukan->keys()->merge($pengeluaran->keys())->unique()->sortDesc();
$laporanKeuanganCollection = $allDates->map(function ($tanggal) use ($pemasukan, $pengeluaran) {
return [
'tanggal' => $tanggal,
'pemasukan' => $pemasukan[$tanggal]->total ?? 0,
'pengeluaran' => $pengeluaran[$tanggal]->total ?? 0,
];
});
// data ditampilkan tiap 10 page
$perPage = 10;
$currentPage = Paginator::resolveCurrentPage();
$currentItems = $laporanKeuanganCollection->slice(($currentPage - 1) * $perPage, $perPage)->values();
$laporanKeuangan = new LengthAwarePaginator(
$currentItems,
$laporanKeuanganCollection->count(),
$perPage,
$currentPage,
['path' => $request->url(), 'query' => $request->query()]
);
$totalPemasukanPerPage = $currentItems->sum('pemasukan');
$totalPengeluaranPerPage = $currentItems->sum('pengeluaran');
$years = range(now()->year, now()->year - 5);
// menampilkan halaman laporan keuangan dengan filter atau tidak seerta membawah data
return view('admin.Laporan.keuangan', compact(
'laporanKeuangan',
'totalPemasukanPerPage',
'totalPengeluaranPerPage',
'years',
'isFilterActive'
));
}
public function export()
{
$laporanPembelian = \App\Models\LaporanPembelian::selectRaw('tanggal, SUM(total) as total_pengeluaran')
->groupBy('tanggal')->pluck('total_pengeluaran', 'tanggal');
$laporanPenjualan = \App\Models\LaporanPenjualan::selectRaw('tanggal, SUM(total) as total_pemasukan')
->groupBy('tanggal')->pluck('total_pemasukan', 'tanggal');
$tanggalGabungan = $laporanPembelian->keys()->merge($laporanPenjualan->keys())->unique()->sortDesc();
$data = collect();
foreach ($tanggalGabungan as $tanggal) {
$data->push([
'tanggal' => $tanggal,
'pemasukan' => $laporanPenjualan[$tanggal] ?? 0,
'pengeluaran' => $laporanPembelian[$tanggal] ?? 0,
]);
}
$filename = 'laporan-keuangan_' . now()->format('Y-m-d_H-i-s') . '.xlsx';
return Excel::download(new LaporanKeuanganExport($data), $filename);
}
}

View File

@ -0,0 +1,90 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\LaporanPenjualan;
use App\Exports\LaporanLabaExport;
use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel;
class LaporanLabaController extends Controller
{
public function index(Request $request)
{
$baseQuery = LaporanPenjualan::with('product');
$filteredQuery = clone $baseQuery;
$isFilterActive = false;
// Terapkan filter jika ada
if ($request->filled('start_date') && $request->filled('end_date')) {
$baseQuery->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$filteredQuery->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$isFilterActive = true;
}
if ($request->filled('month') && $request->filled('year')) {
$baseQuery->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$filteredQuery->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$isFilterActive = true;
} elseif ($request->filled('year')) {
$baseQuery->whereYear('tanggal', $request->year);
$filteredQuery->whereYear('tanggal', $request->year);
$isFilterActive = true;
}
// Data untuk tabel dengan pagination
$laporanLaba = $baseQuery->paginate(10);
// Total laba berdasarkan filter jika ada
$totalLabaKeseluruhan = $filteredQuery->get()->sum(function ($laba) {
return ($laba->harga_jual - ($laba->product->harga_beli ?? 0)) * $laba->jumlah;
});
// Get unique years for filter dropdown
$years = LaporanPenjualan::selectRaw('YEAR(tanggal) as year')
->distinct()
->orderBy('year', 'desc')
->pluck('year');
return view('admin.Laporan.laba', compact('laporanLaba', 'totalLabaKeseluruhan', 'years', 'isFilterActive'));
}
public function export(Request $request)
{
$query = LaporanPenjualan::with('product');
$filterInfo = [];
// Terapkan filter yang sama seperti di index
if ($request->filled('start_date') && $request->filled('end_date')) {
$query->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$filterInfo[] = "periode_{$request->start_date}_sampai_{$request->end_date}";
}
if ($request->filled('month') && $request->filled('year')) {
$query->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$filterInfo[] = "bulan_{$request->month}_{$request->year}";
} elseif ($request->filled('year')) {
$query->whereYear('tanggal', $request->year);
$filterInfo[] = "tahun_{$request->year}";
}
$laporanLaba = $query->get();
$totalLabaKeseluruhan = $laporanLaba->sum(function ($laba) {
return ($laba->harga_jual - ($laba->product->harga_beli ?? 0)) * $laba->jumlah;
});
// Buat nama file dengan informasi filter
$timestamp = now()->format('Y-m-d_H-i-s');
$filterText = !empty($filterInfo) ? '_' . implode('_', $filterInfo) : '';
$filename = "laporan-laba{$filterText}_{$timestamp}.xlsx";
return Excel::download(new LaporanLabaExport($laporanLaba, $totalLabaKeseluruhan), $filename);
}
}

View File

@ -0,0 +1,259 @@
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use App\Models\Product;
use App\Models\Profile;
use Illuminate\Http\Request;
use Barryvdh\DomPDF\Facade\Pdf;
use App\Models\LaporanPembelian;
use Illuminate\Support\Facades\Log;
use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\LaporanPembelianExport;
class LaporanPembelianController extends Controller
{
// Menampilkan daftar laporan pembelian dengan filter dan paginasi
public function index(Request $request)
{
// Membuat query dasar untuk laporan pembelian
$baseQuery = LaporanPembelian::query();
// Mengkloning query untuk digunakan dalam filter
$filteredQuery = clone $baseQuery;
// Variabel untuk menandakan apakah filter aktif
$isFilterActive = false;
// Menerapkan filter berdasarkan rentang tanggal jika ada
if ($request->filled('start_date') && $request->filled('end_date')) {
$baseQuery->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$isFilterActive = true;
}
// Menerapkan filter berdasarkan bulan dan tahun, atau hanya tahun
if ($request->filled('month') && $request->filled('year')) {
$baseQuery->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$isFilterActive = true;
} elseif ($request->filled('year')) {
$baseQuery->whereYear('tanggal', $request->year);
$isFilterActive = true;
}
// Mengambil data laporan pembelian dengan paginasi (10 data per halaman)
$laporanPembelian = $baseQuery->paginate(10);
// Mengambil total jumlah produk yang dibeli, dikelompokkan berdasarkan ID dan nama produk
$totalProduk = LaporanPembelian::select('id_product', 'nama_produk')
->selectRaw('SUM(jumlah) as total_jumlah')
->groupBy('id_product', 'nama_produk')
->get();
// Mengambil daftar tahun unik dari kolom tanggal untuk filter
$years = LaporanPembelian::selectRaw('YEAR(tanggal) as year')
->distinct()
->orderBy('year', 'desc')
->pluck('year');
// Mengembalikan tampilan dengan data laporan, total produk, tahun, dan status filter
return view('admin.Laporan.pembelian', compact('laporanPembelian', 'totalProduk', 'years', 'isFilterActive'));
}
// Menghapus laporan pembelian dari database
public function destroy($id)
{
// Mencari laporan pembelian berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$laporanPembelian = LaporanPembelian::findOrFail($id);
// Menghapus laporan pembelian dari database
$laporanPembelian->delete();
// Mengarahkan kembali ke daftar laporan pembelian dengan pesan sukses
return redirect()->route('pembelian')->with('success', 'Data Laporan Pembelian berhasil dihapus!');
}
// Mengekspor laporan pembelian ke file Excel
public function export(Request $request)
{
// Membuat query dasar untuk laporan pembelian
$query = LaporanPembelian::query();
// Array untuk menyimpan informasi filter untuk nama file
$filterInfo = [];
// Menerapkan filter berdasarkan rentang tanggal jika ada
if ($request->filled('start_date') && $request->filled('end_date')) {
$query->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$filterInfo[] = "periode_{$request->start_date}_sampai_{$request->end_date}";
}
// Menerapkan filter berdasarkan bulan dan tahun, atau hanya tahun
if ($request->filled('month') && $request->filled('year')) {
$query->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$filterInfo[] = "bulan_{$request->month}_{$request->year}";
} elseif ($request->filled('year')) {
$query->whereYear('tanggal', $request->year);
$filterInfo[] = "tahun_{$request->year}";
}
// Mengambil semua data laporan pembelian berdasarkan filter
$laporanPembelian = $query->get();
// Menghitung total pembelian dari semua data
$totalPembelian = $laporanPembelian->sum('total');
// Membuat nama file dengan timestamp dan informasi filter
$timestamp = now()->format('Y-m-d_H-i-s');
$filterText = !empty($filterInfo) ? '_' . implode('_', $filterInfo) : '';
$filename = "laporan-pembelian{$filterText}_{$timestamp}.xlsx";
// Mengekspor data ke file Excel menggunakan kelas LaporanPembelianExport
return Excel::download(new LaporanPembelianExport($laporanPembelian, $totalPembelian), $filename);
}
// Menampilkan formulir untuk menambah laporan pembelian baru
public function create()
{
// Mengambil semua data produk untuk pilihan di formulir
$products = Product::all();
// Mengembalikan tampilan formulir untuk menambah laporan pembelian
return view('admin.Laporan.add-pembelian', compact('products'));
}
// Menyimpan laporan pembelian baru ke database
public function store(Request $request)
{
// Memvalidasi data yang dikirim dari formulir
$validatedData = $request->validate([
'tanggal' => 'required|date', // Tanggal wajib diisi, harus format tanggal
'nama_supplier' => 'required|string', // Nama supplier wajib diisi
'nama_produk' => 'required|string', // Nama produk wajib diisi
'harga_beli' => 'required|numeric', // Harga beli wajib diisi, harus angka
'jumlah' => 'required|numeric', // Jumlah wajib diisi, harus angka
'total_numeric' => 'required|numeric', // Total wajib diisi, harus angka
'id_product' => 'required|numeric' // ID produk wajib diisi, harus angka
]);
// Mencari produk berdasarkan ID untuk memperbarui stok
$product = Product::findOrFail($request->id_product);
// Menambah stok produk berdasarkan jumlah yang dibeli
$product->stok += $request->jumlah;
$product->save();
// Menyimpan data laporan pembelian baru ke database
LaporanPembelian::create([
'tanggal' => $validatedData['tanggal'],
'nama_supplier' => $validatedData['nama_supplier'],
'id_product' => $validatedData['id_product'],
'nama_produk' => $validatedData['nama_produk'],
'harga_beli' => $validatedData['harga_beli'],
'jumlah' => $validatedData['jumlah'],
'total' => $validatedData['total_numeric'], // Menggunakan nilai total asli
]);
// Mengarahkan kembali ke daftar laporan pembelian dengan pesan sukses
return redirect()->route('pembelian')->with('success', 'Produk berhasil ditambahkan');
}
// Menampilkan pratinjau nota pembelian dalam format PDF di browser
public function downloadNota($id)
{
// Mencari laporan pembelian berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$pembelian = LaporanPembelian::findOrFail($id);
// Memformat tanggal ke format 'dd/mm/yyyy'
$tanggal = Carbon::parse($pembelian->tanggal)->format('d/m/Y');
// Membuat nomor nota dengan format 'NOTA-XXXXX' (ID dengan padding nol)
$notaNumber = 'NOTA-' . str_pad($pembelian->id, 5, '0', STR_PAD_LEFT);
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$imageData = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'nota-pembelian' dengan data pembelian, tanggal, nomor nota, logo, dan perusahaan
$pdf = PDF::loadView('admin.Laporan.nota-pembelian', [
'pembelian' => $pembelian,
'tanggal' => $tanggal,
'notaNumber' => $notaNumber,
'logoImage' => $imageData,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas A4 dengan orientasi portrait
$pdf->setPaper('A4', 'portrait');
// Menampilkan PDF di browser tanpa memaksa unduh
return $pdf->stream('nota-pembelian-' . $notaNumber . '.pdf', [
'Attachment' => false
]);
}
// Mengunduh nota pembelian dalam format PDF
public function downloadNotaFile($id)
{
// Mencari laporan pembelian berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$pembelian = LaporanPembelian::findOrFail($id);
// Memformat tanggal ke format 'dd/mm/yyyy'
$tanggal = Carbon::parse($pembelian->tanggal)->format('d/m/Y');
// Membuat nomor nota dengan format 'NOTA-XXXXX' (ID dengan padding nol)
$notaNumber = 'NOTA-' . str_pad($pembelian->id, 5, '0', STR_PAD_LEFT);
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$imageData = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'nota-pembelian' dengan data pembelian, tanggal, nomor nota, logo, dan perusahaan
$pdf = PDF::loadView('admin.Laporan.nota-pembelian', [
'pembelian' => $pembelian,
'tanggal' => $tanggal,
'notaNumber' => $notaNumber,
'logoImage' => $imageData,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas khusus (610x312 poin, sekitar 21.5 cm x 11 cm)
$pdf->setPaper([0, 0, 610, 312]);
// Memaksa unduh PDF dengan nama file sesuai nomor nota
return $pdf->download('nota-pembelian-' . $notaNumber . '.pdf');
}
// Menampilkan pratinjau nota pembelian dalam format PDF di browser dengan penanganan error
public function previewNota($id)
{
try {
// Mencari laporan pembelian berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$pembelian = LaporanPembelian::findOrFail($id);
// Memformat tanggal ke format 'dd/mm/yyyy'
$tanggal = Carbon::parse($pembelian->tanggal)->format('d/m/Y');
// Membuat nomor nota dengan format 'NOTA-XXXXX' (ID dengan padding nol)
$notaNumber = 'NOTA-' . str_pad($pembelian->id, 5, '0', STR_PAD_LEFT);
// Merender tampilan ke HTML terlebih dahulu
$html = view('admin.Laporan.nota-pembelian', [
'pembelian' => $pembelian,
'tanggal' => $tanggal,
'notaNumber' => $notaNumber
])->render();
// Membuat PDF dari HTML yang dirender
$pdf = Pdf::loadHTML($html);
// Mengatur ukuran kertas khusus (610x312 poin, sekitar 21.5 cm x 11 cm) dengan orientasi portrait
$pdf->setPaper([0, 0, 610, 312], 'portrait');
// Menampilkan PDF di browser tanpa memaksa unduh
return $pdf->stream('nota-pembelian-' . $notaNumber . '.pdf', [
'Attachment' => false // false = preview, true = download
]);
} catch (\Exception $e) {
// Mencatat error ke log untuk debugging
Log::error('PDF Generation Error: ' . $e->getMessage());
// Mengembalikan ke halaman sebelumnya dengan pesan error
return back()->with('error', 'Terjadi kesalahan saat generate PDF');
}
}
}

View File

@ -0,0 +1,256 @@
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use App\Models\Product;
use App\Models\Profile;
use Illuminate\Http\Request;
use Barryvdh\DomPDF\Facade\Pdf;
use App\Models\LaporanPenjualan;
use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\LaporanPenjualanExport;
class LaporanPenjualanController extends Controller
{
// Menampilkan daftar laporan penjualan dengan filter dan paginasi
public function index(Request $request)
{
// Membuat query dasar untuk laporan penjualan
$baseQuery = LaporanPenjualan::query();
// Mengkloning query untuk digunakan dalam filter
$filteredQuery = clone $baseQuery;
// Variabel untuk menandakan apakah filter aktif
$isFilterActive = false;
// Menerapkan filter berdasarkan rentang tanggal jika ada
if ($request->filled('start_date') && $request->filled('end_date')) {
$baseQuery->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$filteredQuery->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$isFilterActive = true;
}
// Menerapkan filter berdasarkan bulan dan tahun, atau hanya tahun
if ($request->filled('month') && $request->filled('year')) {
$baseQuery->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$filteredQuery->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$isFilterActive = true;
} elseif ($request->filled('year')) {
$baseQuery->whereYear('tanggal', $request->year);
$filteredQuery->whereYear('tanggal', $request->year);
$isFilterActive = true;
}
// Mengambil data laporan penjualan dengan paginasi (10 data per halaman)
$laporanPenjualan = $baseQuery->paginate(10);
// Mengambil total jumlah produk yang terjual, dikelompokkan berdasarkan ID dan nama produk
$totalProduk = LaporanPenjualan::select('id_product', 'nama_produk')
->selectRaw('SUM(jumlah) as total_jumlah')
->groupBy('id_product', 'nama_produk')
->get();
// Mengambil daftar tahun unik dari kolom tanggal untuk filter
$years = LaporanPenjualan::selectRaw('YEAR(tanggal) as year')
->distinct()
->orderBy('year', 'desc')
->pluck('year');
// Mengembalikan tampilan dengan data laporan, total produk, tahun, dan status filter
return view('admin.Laporan.penjualan', compact('laporanPenjualan', 'totalProduk', 'years', 'isFilterActive'));
}
// Menampilkan formulir untuk menambah laporan penjualan baru
public function create()
{
// Mengambil semua data produk untuk pilihan di formulir
$products = Product::all();
// Mengembalikan tampilan formulir untuk menambah laporan penjualan
return view('admin.Laporan.add-penjualan', compact('products'));
}
// Menghapus laporan penjualan dari database
public function destroy($id)
{
// Mencari laporan penjualan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$laporanPenjualan = LaporanPenjualan::findOrFail($id);
// Menghapus laporan penjualan dari database
$laporanPenjualan->delete();
// Mengarahkan kembali ke daftar laporan penjualan dengan pesan sukses
return redirect()->route('penjualan')->with('success', 'Data Laporan Penjualan berhasil dihapus!');
}
// Mengekspor laporan penjualan ke file Excel
public function export(Request $request)
{
// Membuat query dasar untuk laporan penjualan
$query = LaporanPenjualan::query();
// Array untuk menyimpan informasi filter untuk nama file
$filterInfo = [];
// Menerapkan filter berdasarkan rentang tanggal jika ada
if ($request->filled('start_date') && $request->filled('end_date')) {
$query->whereBetween('tanggal', [$request->start_date, $request->end_date]);
$filterInfo[] = "periode_{$request->start_date}_sampai_{$request->end_date}";
}
// Menerapkan filter berdasarkan bulan dan tahun, atau hanya tahun
if ($request->filled('month') && $request->filled('year')) {
$query->whereMonth('tanggal', $request->month)
->whereYear('tanggal', $request->year);
$filterInfo[] = "bulan_{$request->month}_{$request->year}";
} elseif ($request->filled('year')) {
$query->whereYear('tanggal', $request->year);
$filterInfo[] = "tahun_{$request->year}";
}
// Mengambil semua data laporan penjualan berdasarkan filter
$laporanPenjualan = $query->get();
// Menghitung total penjualan dari semua data
$totalPenjualan = $laporanPenjualan->sum('total');
// Membuat nama file dengan timestamp dan informasi filter
$timestamp = now()->format('Y-m-d_H-i-s');
$filterText = !empty($filterInfo) ? '_' . implode('_', $filterInfo) : '';
$filename = "laporan-penjualan{$filterText}_{$timestamp}.xlsx";
// Mengekspor data ke file Excel menggunakan kelas LaporanPenjualanExport
return Excel::download(new LaporanPenjualanExport($laporanPenjualan, $totalPenjualan), $filename);
}
// Menyimpan laporan penjualan baru ke database
public function store(Request $request)
{
// Memvalidasi data yang dikirim dari formulir
$validateData = $request->validate([
'tanggal' => 'required|date', // Tanggal wajib diisi, harus format tanggal
'nama_pembeli' => 'required|string', // Nama pembeli wajib diisi
'nama_produk' => 'required|string', // Nama produk wajib diisi
'harga_jual' => 'required|numeric', // Harga jual wajib diisi, harus angka
'jumlah' => 'required|numeric', // Jumlah wajib diisi, harus angka
'id_product' => 'required|numeric' // ID produk wajib diisi, harus angka
]);
// Memeriksa apakah stok produk mencukupi
$product = Product::findOrFail($request->id_product);
if ($product->stok < $request->jumlah) {
// Mengembalikan ke halaman sebelumnya dengan pesan error jika stok tidak cukup
return redirect()->back()->with('error', 'Stok tidak mencukupi. Stok tersedia: ' . $product->stok)->withInput();
}
// Mengurangi stok produk berdasarkan jumlah yang dijual
$product->stok -= $request->jumlah;
$product->save();
// Menghitung total penjualan (harga jual x jumlah)
$total = $request->harga_jual * $request->jumlah;
// Mengonversi nomor telepon ke string
$no_telp = strval($request->no_telepon);
// Menyimpan data laporan penjualan baru ke database
LaporanPenjualan::create([
'tanggal' => $request->tanggal,
'no_telepon' => $no_telp,
'alamat' => $request->alamat,
'nama_pembeli' => $request->nama_pembeli,
'nama_produk' => $request->nama_produk,
'harga_jual' => $request->harga_jual,
'harga_beli' => $product->harga_beli,
'jumlah' => $request->jumlah,
'total' => $total,
'id_product' => $request->id_product
]);
// Mengarahkan kembali ke daftar laporan penjualan dengan pesan sukses
return redirect()->route('penjualan')->with('success', 'Data penjualan berhasil ditambahkan');
}
// Menampilkan pratinjau nota penjualan dalam format PDF di browser
public function previewNota($id)
{
// Mencari laporan penjualan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$penjualan = LaporanPenjualan::findOrFail($id);
// Memformat tanggal ke format 'dd/mm/yyyy'
$tanggal = Carbon::parse($penjualan->tanggal)->format('d/m/Y');
// Membuat nomor nota dengan format 'NOTA-XXXXX' (ID dengan padding nol)
$notaNumber = 'NOTA-' . str_pad($penjualan->id, 5, '0', STR_PAD_LEFT);
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$imageData = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'nota-penjualan' dengan data penjualan, tanggal, nomor nota, logo, dan perusahaan
$pdf = PDF::loadView('admin.Laporan.nota-penjualan', [
'penjualan' => $penjualan,
'tanggal' => $tanggal,
'notaNumber' => $notaNumber,
'logoImage' => $imageData,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas A4 dengan orientasi portrait
$pdf->setPaper('A4', 'portrait');
// Mengatur opsi PDF untuk rendering yang lebih baik
$pdf->setOptions([
'dpi' => 150,
'defaultFont' => 'sans-serif',
'isHtml5ParserEnabled' => true,
'isRemoteEnabled' => true,
'isFontSubsettingEnabled' => true,
'isPhpEnabled' => true,
]);
// Menampilkan PDF di browser tanpa memaksa unduh
return $pdf->stream('nota-penjualan-' . $notaNumber . '.pdf', [
'Attachment' => false
]);
}
// Mengunduh nota penjualan dalam format PDF
public function downloadNotaFile($id)
{
// Mencari laporan penjualan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$penjualan = LaporanPenjualan::findOrFail($id);
// Memformat tanggal ke format 'dd/mm/yyyy'
$tanggal = Carbon::parse($penjualan->tanggal)->format('d/m/Y');
// Membuat nomor nota dengan format 'NOTA-XXXXX' (ID dengan padding nol)
$notaNumber = 'NOTA-' . str_pad($penjualan->id, 5, '0', STR_PAD_LEFT);
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$imageData = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'nota-penjualan' dengan data penjualan, tanggal, nomor nota, logo, dan perusahaan
$pdf = PDF::loadView('admin.Laporan.nota-penjualan', [
'penjualan' => $penjualan,
'tanggal' => $tanggal,
'notaNumber' => $notaNumber,
'logoImage' => $imageData,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas A4 dengan orientasi portrait
$pdf->setPaper('A4', 'portrait');
// Mengatur opsi PDF untuk rendering yang lebih baik
$pdf->setOptions([
'dpi' => 150,
'defaultFont' => 'sans-serif',
'isHtml5ParserEnabled' => true,
'isRemoteEnabled' => true,
'isFontSubsettingEnabled' => true,
'isPhpEnabled' => true,
]);
// Memaksa unduh PDF dengan nama file sesuai nomor nota
return $pdf->download('nota-penjualan-' . $notaNumber . '.pdf');
}
}

View File

@ -0,0 +1,100 @@
<?php
namespace App\Http\Controllers;
use App\Models\Product;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ProductController extends Controller
{
// Menampilkan daftar produk dengan paginasi
public function index()
{
// Mengambil semua data produk dari database dengan paginasi (10 data per halaman)
$products = Product::paginate(10);
// Mengirim data produk ke tampilan 'admin.product.product'
return view('admin.product.product', compact('products'));
}
// Menampilkan formulir untuk membuat produk baru
public function create()
{
// Mengembalikan tampilan formulir untuk menambah produk baru
return view('admin.product.addproduct');
}
// Menyimpan produk baru ke database
public function store(Request $request)
{
// Memvalidasi data yang dikirim dari formulir
$request->validate([
'nama_produk' => 'required|string|max:255', // Nama produk wajib diisi, maksimal 255 karakter
'harga_beli' => 'required|numeric', // Harga beli wajib diisi, harus angka
'harga_jual' => 'required|numeric', // Harga jual wajib diisi, harus angka
]);
// Memeriksa apakah harga beli lebih tinggi dari harga jual
if ($request->harga_beli > $request->harga_jual) {
// Mengembalikan ke halaman sebelumnya dengan pesan error jika harga beli lebih tinggi
return redirect()->back()->with('error', 'Harga beli tidak boleh lebih tinggi dari harga jual');
}
// Menyimpan data produk baru ke database
Product::create([
'nama_produk' => $request->nama_produk,
'harga_beli' => $request->harga_beli,
'harga_jual' => $request->harga_jual,
]);
// Mengarahkan kembali ke daftar produk dengan pesan sukses
return redirect()->route('product')->with('success', 'Produk berhasil ditambahkan!');
}
// Memperbarui data produk yang sudah ada
public function update(Request $request, $id)
{
// Memvalidasi data yang dikirim dari formulir
$request->validate([
'nama_produk' => 'required|string|max:255', // Nama produk wajib diisi, maksimal 255 karakter
'harga_beli' => 'required|numeric', // Harga beli wajib diisi, harus angka
'harga_jual' => 'required|numeric', // Harga jual wajib diisi, harus angka
]);
// Mencari produk berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$produk = Product::findOrFail($id);
// Memeriksa apakah harga beli lebih tinggi dari harga jual
if ($request->harga_beli > $request->harga_jual) {
// Mengembalikan ke halaman sebelumnya dengan pesan error, data input sebelumnya, dan ID produk untuk edit
return redirect()->back()
->withErrors(['harga_beli' => 'Harga beli tidak boleh lebih tinggi dari harga jual'])
->withInput()
->with('edit_id', $id);
}
// Memperbarui data produk dengan data yang sudah divalidasi
$produk->update([
'nama_produk' => $request->nama_produk,
'harga_beli' => $request->harga_beli,
'harga_jual' => $request->harga_jual,
]);
// Mengarahkan kembali ke daftar produk dengan pesan sukses
return redirect()->route('product')->with('success', 'Produk Berhasil diperbarui');
}
// Menghapus produk dari database
public function destroy($id)
{
// Mencari produk berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$product = Product::findOrFail($id);
// Menghapus produk dari database
$product->delete();
// Mengarahkan kembali ke daftar produk dengan pesan sukses
return redirect()->route('product')->with('success', 'Produk berhasil dihapus!');
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Http\Controllers;
use App\Models\Profile;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Storage;
class ProfileController extends Controller
{
// menampilkan halaman profil
public function index()
{
// mengambil data profil
$data = Profile::find(1);
// menampilkan halaman profil dengan data profil
return view('admin.profil', compact('data'));
}
// Memperbarui data profil perusahaan berdasarkan ID
public function update(Request $request, $id)
{
// Mencari data profil berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$profile = Profile::findOrFail($id);
// Memvalidasi data yang dikirim dari formulir
$validatedData = $request->validate([
'company' => 'required|string|max:255', // Nama perusahaan wajib diisi, maksimal 255 karakter
'alamat_company' => 'required|string', // Alamat perusahaan wajib diisi
'no_telp' => 'required|string|max:15', // Nomor telepon wajib diisi, maksimal 15 karakter
'email_company' => 'required|email|max:255', // Email perusahaan wajib diisi, harus format email valid, maksimal 255 karakter
'owner' => 'required|string|max:255', // Nama pemilik wajib diisi, maksimal 255 karakter
'logo_company' => 'nullable|image|mimes:jpeg,png,jpg|max:2048', // Logo perusahaan opsional, harus gambar (jpeg, png, jpg), maksimal 2MB
]);
// Menangani unggahan file logo hanya jika ada file baru yang dipilih
if ($request->hasFile('logo_company')) {
// Menghapus logo lama dari penyimpanan jika ada
if ($profile->logo_company) {
Storage::disk('public')->delete('logos/' . $profile->logo_company);
}
// Menyimpan logo baru di direktori 'logos' pada disk public
$file = $request->file('logo_company');
$fileName = time() . '_' . $file->getClientOriginalName(); // Membuat nama file unik dengan timestamp
$file->storeAs('logos', $fileName, 'public');
// Memperbarui kolom logo_company dengan nama file baru
$profile->logo_company = $fileName;
}
// Memperbarui data profil dengan data yang sudah divalidasi
$profile->company = $validatedData['company'];
$profile->alamat_company = $validatedData['alamat_company'];
$profile->no_telp = $validatedData['no_telp'];
$profile->email_company = $validatedData['email_company'];
$profile->owner = $validatedData['owner'];
// Menyimpan perubahan ke database
$profile->save();
// Mengarahkan kembali ke halaman profil dengan pesan sukses
return redirect()->route('profile')->with('success', 'Data Profil Berhasil Diubah');
}
}

View File

@ -0,0 +1,204 @@
<?php
namespace App\Http\Controllers;
use Exception;
use App\Models\Product;
use App\Models\Profile;
use App\Models\SuratJalan;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Support\Facades\Log;
use App\Http\Controllers\Controller;
class SuratJalanController extends Controller
{
// Menampilkan daftar Surat Jalan dengan paginasi dan semua produk
public function index()
{
// Mengambil data Surat Jalan dengan paginasi (10 data per halaman)
$letters = SuratJalan::paginate(10);
// Mengambil semua data produk dari database
$products = Product::all();
// Mengembalikan tampilan untuk menampilkan daftar Surat Jalan dengan data letters dan products
return view('admin.administrasi.surat-jalan', compact('letters', 'products'));
}
// Menampilkan formulir untuk membuat Surat Jalan baru
public function create()
{
// Mengambil ID terakhir untuk membuat nomor Surat Jalan unik
$lastId = SuratJalan::max('id') + 1;
// Mengambil bulan dan tahun saat ini untuk format nomor Surat Jalan
$monthYear = Carbon::now()->format('m/Y');
// Mengambil semua data produk untuk pilihan di formulir
$products = Product::all();
// Membuat nomor Surat Jalan dengan format "SJ/XX/LEP/MM/YYYY"
$noSurat = "SJ/" . str_pad($lastId, 2, '0', STR_PAD_LEFT) . "/LEP/" . $monthYear;
// Mengembalikan tampilan formulir untuk membuat Surat Jalan baru dengan nomor dan produk
return view('admin.administrasi.add-surat-jalan', compact('noSurat', 'products'));
}
// Menyimpan Surat Jalan baru ke database
public function store(Request $request)
{
try {
// Memvalidasi data yang dikirim dari formulir
$validate = $request->validate([
'nama_penerima' => 'required|string',
'nama_produk' => 'required|string',
'jenis_kendaraan' => 'required',
'no_pol' => 'required|string',
'jumlah' => 'required|numeric|min:0',
'no_surat' => 'required|string',
'tanggal' => 'required|date',
'masa' => 'required|date'
]);
// Memformat tanggal ke format 'Y-m-d' untuk disimpan di database
$tanggalFormatted = date('Y-m-d', strtotime($validate['tanggal']));
// Menghitung masa berlaku (6 bulan dari tanggal) dan memformatnya
$masaFormatted = \Carbon\Carbon::parse($tanggalFormatted)->addMonths(6)->format('Y-m-d');
// Mengambil ID terakhir untuk membuat nomor Surat Jalan unik
$lastId = SuratJalan::max('id') + 1;
// Mengambil bulan dan tahun saat ini untuk nomor Surat Jalan
$monthYear = Carbon::now()->format('m/Y');
// Membuat nomor Surat Jalan dengan format "SJ/XX/LEP/MM/YYYY"
$noSurat = "SJ/" . str_pad($lastId, 2, '0', STR_PAD_LEFT) . "/LEP/" . $monthYear;
// Menyimpan data Surat Jalan baru ke database dengan data yang sudah divalidasi
SuratJalan::create([
'nama_penerima' => $validate['nama_penerima'],
'nama_produk' => $validate['nama_produk'],
'jenis_kendaraan' => $validate['jenis_kendaraan'],
'no_pol' => $validate['no_pol'],
'tanggal' => $tanggalFormatted,
'masa' => $masaFormatted,
'jumlah' => $validate['jumlah'],
'no_surat' => $noSurat,
]);
// Mengarahkan kembali ke daftar Surat Jalan dengan pesan sukses
return redirect()->route('surat-jalan')->with('success', 'Surat jalan berhasil dibuat.');
} catch (\Exception $e) {
// Mencatat error ke log untuk keperluan debugging
Log::error('Gagal menyimpan surat jalan', [
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
'data' => $request->all(), // Mencatat data input untuk diperiksa
]);
// Mengarahkan kembali ke halaman sebelumnya dengan pesan error
return redirect()->back()->with('error', 'Terjadi kesalahan. Silakan cek log untuk detail.');
}
}
// Memperbarui data Surat Jalan yang sudah ada
public function update(Request $request, $id)
{
// Memvalidasi data yang dikirim dari formulir
$validate = $request->validate([
'nama_penerima' => 'required|string|max:255',
'jenis_kendaraan' => 'required|string',
'no_pol' => 'required|string',
'tanggal' => 'required|date',
'jumlah' => 'required|numeric|min:0',
'masa' => 'required|date',
'tanggal' => 'required|date'
]);
// Memformat tanggal ke format 'Y-m-d' untuk disimpan di database
$tanggalFormatted = date('Y-m-d', strtotime($validate['tanggal']));
// Menghitung masa berlaku (6 bulan dari tanggal) dan memformatnya
$masaFormatted = \Carbon\Carbon::parse($tanggalFormatted)->addMonths(6)->format('Y-m-d');
// Mencari Surat Jalan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$suratJalan = SuratJalan::findOrFail($id);
// Memperbarui data Surat Jalan dengan data yang sudah divalidasi
$suratJalan->update([
'nama_penerima' => $request->nama_penerima,
'no_pol' => $request->no_pol,
// 'nama_produk' => $request->nama_produk, // Dikomentari, mungkin tidak diupdate
'jenis_kendaraan' => $request->jenis_kendaraan,
'jumlah' => $request->jumlah,
'tanggal' => $tanggalFormatted,
'masa' => $masaFormatted
]);
// Mengarahkan kembali ke daftar Surat Jalan dengan pesan sukses
return redirect()->route('surat-jalan')->with('success', 'Data Surat Jalan Berhasil diperbarui');
}
// Menampilkan pratinjau Surat Jalan dalam format PDF di browser
public function preview($id)
{
// Mencari Surat Jalan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$suratJalan = SuratJalan::findOrFail($id);
// Memformat tanggal ke format yang mudah dibaca (misalnya, "18 Mei 2025")
$tanggal = Carbon::parse($suratJalan->tanggal)->format('d F Y');
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64 untuk disisipkan di PDF
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$logoImage = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'view-surat-jalan' dengan data Surat Jalan, tanggal, logo, dan perusahaan
$pdf = PDF::loadView('admin.administrasi.view-surat-jalan', [
'suratJalan' => $suratJalan,
'tanggal' => $tanggal,
'logoImage' => $logoImage,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas khusus untuk PDF (610x312 poin)
$pdf->setPaper([0, 0, 610, 312]);
// Mengganti karakter slash di no_surat untuk membuat nama file yang aman
$cleanFileName = str_replace(['/', '\\'], '-', $suratJalan->no_surat);
// Menampilkan PDF di browser tanpa memaksa unduh
return $pdf->stream('surat-jalan-' . $cleanFileName . '.pdf', [
'Attachment' => false
]);
}
// Mengunduh Surat Jalan dalam format PDF
public function download($id)
{
// Mencari Surat Jalan berdasarkan ID, jika tidak ditemukan akan memunculkan error 404
$suratJalan = SuratJalan::findOrFail($id);
// Memformat tanggal ke format yang mudah dibaca (misalnya, "18 Mei 2025")
$tanggal = Carbon::parse($suratJalan->tanggal)->format('d F Y');
// Mengambil data profil perusahaan (dengan ID = 1)
$dataPerusahaan = Profile::find(1);
// Mengambil logo perusahaan dari penyimpanan dan mengubahnya ke format base64 untuk disisipkan di PDF
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$logoImage = base64_encode(file_get_contents($imagePath));
// Membuat PDF menggunakan tampilan 'view-surat-jalan' dengan data Surat Jalan, tanggal, logo, dan perusahaan
$pdf = PDF::loadView('admin.administrasi.view-surat-jalan', [
'suratJalan' => $suratJalan,
'tanggal' => $tanggal,
'logoImage' => $logoImage,
'data' => $dataPerusahaan
]);
// Mengatur ukuran kertas khusus untuk PDF (610x312 poin)
$pdf->setPaper([0, 0, 610, 312]);
// Mengganti karakter slash di no_surat untuk membuat nama file yang aman
$cleanFileName = str_replace(['/', '\\'], '-', $suratJalan->no_surat);
// Memaksa unduh PDF dengan nama file yang ditentukan
return $pdf->download('surat-jalan-' . $cleanFileName . '.pdf');
}
}

View File

@ -0,0 +1,159 @@
<?php
namespace App\Http\Controllers;
use Exception;
use App\Models\Profile;
use App\Models\SuratTugas;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Barryvdh\DomPDF\Facade\Pdf;
use App\Http\Controllers\Controller;
class SuratTugasController extends Controller
{
// menampilkan halaman surat tugas
public function index()
{
$letters = SuratTugas::paginate(10);
return view('admin.administrasi.surat-tugas', compact('letters'));
}
// menampilkan halaman tambah surat tugas
public function create()
{
$lastId = SuratTugas::max('id') + 1;
$monthYear = Carbon::now()->format('m/Y');
// membuat nomer surat
$noSurat = "ST/" . str_pad($lastId, 2, '0', STR_PAD_LEFT) . "/LEP/" . $monthYear;
return view('admin.administrasi.add-surat', compact('noSurat'));
}
public function store(Request $request)
{
try {
$validate = $request->validate([
'nama' => 'required|string',
'no_ktp' => 'required|digits:16',
'no_surat' => 'required|string',
'alamat' => 'required|string',
'masa' => 'required|date',
'tanggal' => 'required|date'
]);
// mendapatkan tanggal sekarang dan konversi
$tanggalFormatted = date('Y-m-d', strtotime($validate['tanggal']));
$masaFormatted = \Carbon\Carbon::parse($tanggalFormatted)->addMonths(6)->format('Y-m-d');
// Ambil ID terakhir
$lastId = SuratTugas::max('id') + 1;
$monthYear = Carbon::now()->format('m/Y');
// Buat format No Surat
$noSurat = "ST/" . str_pad($lastId, 2, '0', STR_PAD_LEFT) . "/LEP/" . $monthYear;
// fungsi menambahkan surat tugas ke database
SuratTugas::create([
'nama' => $validate['nama'],
'no_ktp' => $validate['no_ktp'],
'alamat' => $validate['alamat'],
'tanggal' => $tanggalFormatted,
'masa' => $masaFormatted, // Tidak ambil dari request
'no_surat' => $noSurat,
]);
// mengembbalikan ke dalam halaman surat tugas
return redirect()->route('surat-tugas')->with('success', 'Surat tugas berhasil dibuat.');
} catch (\Illuminate\Validation\ValidationException $e) {
return redirect()->back()->withErrors($e->validator)->withInput();
} catch (Exception $e) {
// dd($e->getMessage());
return redirect()->back()->with('error', 'Error: ' . $e->getMessage()); // Pastikan error ditampilkan
}
}
// menampilkan review surat tugas
public function preview($id)
{
$suratTugas = SuratTugas::findOrFail($id);
// Format tanggal
$tanggal = Carbon::parse($suratTugas->tanggal)->format('d F Y');
$dataPerusahaan = Profile::find(1);
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$logoImage = base64_encode(file_get_contents($imagePath));
$pdf = PDF::loadView('admin.administrasi.view-surat-tugas', [
'suratTugas' => $suratTugas,
'tanggal' => $tanggal,
'logoImage' => $logoImage,
'data' => $dataPerusahaan
]);
$pdf->setPaper('A4', 'portrait');
$cleanFileName = str_replace(['/', '\\'], '-', $suratTugas->no_surat);
return $pdf->stream('surat-tugas-' . $cleanFileName . '.pdf', [
'Attachment' => false
]);
}
// fungsi untuk download surat ke perangkat
public function download($id)
{
$suratTugas = SuratTugas::findOrFail($id);
// Format tanggal
$tanggal = Carbon::parse($suratTugas->tanggal)->format('d F Y');
// mendapatkan data company dari database
$dataPerusahaan = Profile::find(1);
// load gambar
$imagePath = public_path('storage/logos/' . $dataPerusahaan->logo_company);
$logoImage = base64_encode(file_get_contents($imagePath));
$pdf = PDF::loadView('admin.administrasi.view-surat-tugas', [
'suratTugas' => $suratTugas,
'tanggal' => $tanggal,
'logoImage' => $logoImage,
'data' => $dataPerusahaan
]);
$pdf->setPaper('A4', 'portrait');
// format nama
$cleanFileName = str_replace(['/', '\\'], '-', $suratTugas->no_surat);
// Force download
return $pdf->download('surat-tugas-' . $cleanFileName . '.pdf');
}
// fungsi ubah data dari surat tugas
public function update(Request $request, $id)
{
// validasi data yang dimasukkan
$validate = $request->validate([
'nama' => 'required|string|max:255',
'no_ktp' => 'required|numeric',
'alamat' => 'required|string',
'masa' => 'required|date',
'tanggal' => 'required|date'
]);
// format tanggal
$tanggalFormatted = date('Y-m-d', strtotime($validate['tanggal']));
$masaFormatted = \Carbon\Carbon::parse($tanggalFormatted)->addMonths(6)->format('Y-m-d');
$suratTugas = SuratTugas::findOrFail($id);
// fungsi ubah data yang diperlukan
$suratTugas->update([
'nama' => $request->nama,
'no_ktp' => $request->no_ktp,
'alamat' => $request->alamat,
'tanggal' => $tanggalFormatted,
'masa' => $masaFormatted
]);
return redirect()->route('surat-tugas')->with('success', 'Data Surat Tugas Berhasil diperbarui');
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class PreventBackHistory
{
public function handle(Request $request, Closure $next)
{
$response = $next($request);
return $response->header('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate')
->header('Pragma', 'no-cache')
->header('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT');
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class LaporanPembelian extends Model
{
//
use HasFactory, Notifiable;
protected $table = 'laporan_pembelian';
protected $fillable = [
'tanggal',
'nama_supplier',
'nama_produk',
'harga_beli',
'jumlah',
'total',
'id_product'
];
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class LaporanPenjualan extends Model
{
use HasFactory, Notifiable;
protected $table = 'laporan_penjualan';
protected $fillable = [
'tanggal',
'nama_pembeli',
'alamat',
'no_telepon',
'nama_produk',
'harga_beli',
'harga_jual',
'jumlah',
'total',
'id_product'
];
public function product()
{
return $this->belongsTo(Product::class, 'id_product');
}
}

20
app/Models/Product.php Normal file
View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class Product extends Model
{
//
use HasFactory, Notifiable;
protected $table = 'product';
protected $fillable = [
'nama_produk',
'harga_beli',
'harga_jual',
'stok'
];
}

19
app/Models/Profile.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Profile extends Model
{
//
protected $table = 'company';
protected $fillable = [
'company',
'alamat_company',
'no_telp',
'owner',
'email_company',
'logo_company'
];
}

20
app/Models/SuratJalan.php Normal file
View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SuratJalan extends Model
{
//
protected $table = 'surat_jalan';
protected $fillable = [
'tanggal',
'nama_penerima',
'nama_produk',
'jenis_kendaraan',
'no_pol',
'jumlah',
'no_surat'
];
}

18
app/Models/SuratTugas.php Normal file
View File

@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SuratTugas extends Model
{
protected $table = 'surat_tugas';
protected $fillable = [
'nama',
'no_ktp',
'no_surat',
'alamat',
'tanggal',
'masa'
];
}

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

@ -0,0 +1,65 @@
<?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Notifications\ResetPasswordNotification;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements MustVerifyEmail
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
use \Illuminate\Auth\MustVerifyEmail;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
public function sendEmailVerificationNotification()
{
$this->notify(new \App\Notifications\VerifyEmailNotification);
}
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
public function shouldVerifyEmail()
{
return !$this->hasVerifiedEmail();
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ResetPasswordNotification extends Notification
{
use Queueable;
public $token;
public function __construct($token)
{
$this->token = $token;
}
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
$url = url(route('password.reset', [
'token' => $this->token,
'email' => $notifiable->getEmailForPasswordReset(),
], false));
return (new MailMessage)
->subject('Atur Ulang Kata Sandi - CV Lumintu Energi Persada')
->view('auth.template-password', ['url' => $url]);
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Notifications;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Config;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class VerifyEmailNotification extends Notification
{
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
$verificationUrl = $this->verificationUrl($notifiable);
return (new MailMessage)
->subject('Verifikasi Email - CV Lumintu Energi Persada')
->view('auth.template-email', ['url' => $verificationUrl]);
}
protected function verificationUrl($notifiable)
{
return URL::temporarySignedRoute(
'verification.verify',
Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
[
'id' => $notifiable->getKey(),
'hash' => sha1($notifiable->getEmailForVerification()),
]
);
}
}

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

15
artisan Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Input\ArgvInput;
define('LARAVEL_START', microtime(true));
// Register the Composer autoloader...
require __DIR__.'/vendor/autoload.php';
// Bootstrap Laravel and handle the command...
$status = (require_once __DIR__.'/bootstrap/app.php')
->handleCommand(new ArgvInput);
exit($status);

18
bootstrap/app.php Normal file
View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();

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

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

5
bootstrap/providers.php Normal file
View File

@ -0,0 +1,5 @@
<?php
return [
App\Providers\AppServiceProvider::class,
];

17
catatan_penting.txt Normal file
View File

@ -0,0 +1,17 @@
STRUKTUR & FOLDER PENTING DALAM PROJECT
1. Controllers -> penulisan logic untuk system yang dibuat
2. Models -> Digunakan untuk mendefinisikan Tabel dan column pada database yang nantinya untuk GET,INSERT,DELETE data
3. views -> digunakan untuk menampilkan halaman website yang dibuat dengan tag HTML (FRONT END) dengan format .blade.php
4. public -> untuk menyimpan asset asset public yang diakses banyak orang
5. routes/web -> digunakan untuk konfigurasi routing aplikasi untuk berpindah pindah page
6. storage -> untuk menyimpan asset yang didownload atau diupload
7. .env -> digunakan untuk setting environment konfigurasi website
LETAK FOLDER
1. Controllers => app/http/Controllers/...
2. Models => app/http/Models/...
3. views => resources/views/...
4. public => public/....
5. routes => routes/web/...
6. storage => storage/...

73
composer.json Normal file
View File

@ -0,0 +1,73 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"barryvdh/laravel-dompdf": "^3.1",
"laravel/framework": "^11.31",
"laravel/tinker": "^2.9",
"maatwebsite/excel": "^3.1"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.1",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11.0.1"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
]
},
"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
}

9044
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

126
config/app.php Normal file
View File

@ -0,0 +1,126 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| other UI elements where an application name needs to be displayed.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| the application so that it's available within Artisan commands.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/
'timezone' => env('APP_TIMEZONE', 'UTC'),
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by Laravel's translation / localization methods. This option can be
| set to any locale for which you plan to have translation strings.
|
*/
'locale' => 'id',
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string to ensure that all encrypted values
| are secure. You should do this prior to deploying the application.
|
*/
'cipher' => 'AES-256-CBC',
'key' => env('APP_KEY'),
'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
),
],
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
];

115
config/auth.php Normal file
View File

@ -0,0 +1,115 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];

108
config/cache.php Normal file
View File

@ -0,0 +1,108 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache store that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a cache operation inside the application.
|
*/
'default' => env('CACHE_STORE', 'database'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

173
config/database.php Normal file
View File

@ -0,0 +1,173 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for database operations. This is
| the connection which will be utilized unless another connection
| is explicitly specified when you execute a query / statement.
|
*/
'default' => env('DB_CONNECTION', 'sqlite'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Below are all of the database connections defined for your application.
| An example configuration is provided for each database system which
| is supported by Laravel. You're free to add / remove connections.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run on the database.
|
*/
'migrations' => [
'table' => 'migrations',
'update_date_on_publish' => true,
],
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as Memcached. You may define your connection settings here.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'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'),
],
],
];

301
config/dompdf.php Normal file
View File

@ -0,0 +1,301 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Set some default values. It is possible to add all defines that can be set
| in dompdf_config.inc.php. You can also override the entire config file.
|
*/
'show_warnings' => false, // Throw an Exception on warnings from dompdf
'public_path' => null, // Override the public path if needed
/*
* Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show and £.
*/
'convert_entities' => true,
'options' => [
/**
* The location of the DOMPDF font directory
*
* The location of the directory where DOMPDF will store fonts and font metrics
* Note: This directory must exist and be writable by the webserver process.
* *Please note the trailing slash.*
*
* Notes regarding fonts:
* Additional .afm font metrics can be added by executing load_font.php from command line.
*
* Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
* be embedded in the pdf file or the PDF may not display correctly. This can significantly
* increase file size unless font subsetting is enabled. Before embedding a font please
* review your rights under the font license.
*
* Any font specification in the source HTML is translated to the closest font available
* in the font directory.
*
* The pdf standard "Base 14 fonts" are:
* Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
* Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
* Symbol, ZapfDingbats.
*/
'font_dir' => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
/**
* The location of the DOMPDF font cache directory
*
* This directory contains the cached font metrics for the fonts used by DOMPDF.
* This directory can be the same as DOMPDF_FONT_DIR
*
* Note: This directory must exist and be writable by the webserver process.
*/
'font_cache' => storage_path('fonts'),
/**
* The location of a temporary directory.
*
* The directory specified must be writeable by the webserver process.
* The temporary directory is required to download remote images and when
* using the PDFLib back end.
*/
'temp_dir' => sys_get_temp_dir(),
/**
* ==== IMPORTANT ====
*
* dompdf's "chroot": Prevents dompdf from accessing system files or other
* files on the webserver. All local files opened by dompdf must be in a
* subdirectory of this directory. DO NOT set it to '/' since this could
* allow an attacker to use dompdf to read any files on the server. This
* should be an absolute path.
* This is only checked on command line call by dompdf.php, but not by
* direct class use like:
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
*/
'chroot' => realpath(base_path()),
/**
* Protocol whitelist
*
* Protocols and PHP wrappers allowed in URIs, and the validation rules
* that determine if a resouce may be loaded. Full support is not guaranteed
* for the protocols/wrappers specified
* by this array.
*
* @var array
*/
'allowed_protocols' => [
'data://' => ['rules' => []],
'file://' => ['rules' => []],
'http://' => ['rules' => []],
'https://' => ['rules' => []],
],
/**
* Operational artifact (log files, temporary files) path validation
*/
'artifactPathValidation' => null,
/**
* @var string
*/
'log_output_file' => null,
/**
* Whether to enable font subsetting or not.
*/
'enable_font_subsetting' => false,
/**
* The PDF rendering backend to use
*
* Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
* 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
* fall back on CPDF. 'GD' renders PDFs to graphic files.
* {@link * Canvas_Factory} ultimately determines which rendering class to
* instantiate based on this setting.
*
* Both PDFLib & CPDF rendering backends provide sufficient rendering
* capabilities for dompdf, however additional features (e.g. object,
* image and font support, etc.) differ between backends. Please see
* {@link PDFLib_Adapter} for more information on the PDFLib backend
* and {@link CPDF_Adapter} and lib/class.pdf.php for more information
* on CPDF. Also see the documentation for each backend at the links
* below.
*
* The GD rendering backend is a little different than PDFLib and
* CPDF. Several features of CPDF and PDFLib are not supported or do
* not make any sense when creating image files. For example,
* multiple pages are not supported, nor are PDF 'objects'. Have a
* look at {@link GD_Adapter} for more information. GD support is
* experimental, so use it at your own risk.
*
* @link http://www.pdflib.com
* @link http://www.ros.co.nz/pdf
* @link http://www.php.net/image
*/
'pdf_backend' => 'CPDF',
/**
* html target media view which should be rendered into pdf.
* List of types and parsing rules for future extensions:
* http://www.w3.org/TR/REC-html40/types.html
* screen, tty, tv, projection, handheld, print, braille, aural, all
* Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
* Note, even though the generated pdf file is intended for print output,
* the desired content might be different (e.g. screen or projection view of html file).
* Therefore allow specification of content here.
*/
'default_media_type' => 'screen',
/**
* The default paper size.
*
* North America standard is "letter"; other countries generally "a4"
*
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
*/
'default_paper_size' => 'a4',
/**
* The default paper orientation.
*
* The orientation of the page (portrait or landscape).
*
* @var string
*/
'default_paper_orientation' => 'portrait',
/**
* The default font family
*
* Used if no suitable fonts can be found. This must exist in the font folder.
*
* @var string
*/
'default_font' => 'serif',
/**
* Image DPI setting
*
* This setting determines the default DPI setting for images and fonts. The
* DPI may be overridden for inline images by explictly setting the
* image's width & height style attributes (i.e. if the image's native
* width is 600 pixels and you specify the image's width as 72 points,
* the image will have a DPI of 600 in the rendered PDF. The DPI of
* background images can not be overridden and is controlled entirely
* via this parameter.
*
* For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
* If a size in html is given as px (or without unit as image size),
* this tells the corresponding size in pt.
* This adjusts the relative sizes to be similar to the rendering of the
* html page in a reference browser.
*
* In pdf, always 1 pt = 1/72 inch
*
* Rendering resolution of various browsers in px per inch:
* Windows Firefox and Internet Explorer:
* SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
* Linux Firefox:
* about:config *resolution: Default:96
* (xorg screen dimension in mm and Desktop font dpi settings are ignored)
*
* Take care about extra font/image zoom factor of browser.
*
* In images, <img> size in pixel attribute, img css style, are overriding
* the real image dimension in px for rendering.
*
* @var int
*/
'dpi' => 96,
/**
* Enable embedded PHP
*
* If this setting is set to true then DOMPDF will automatically evaluate embedded PHP contained
* within <script type="text/php"> ... </script> tags.
*
* ==== IMPORTANT ==== Enabling this for documents you do not trust (e.g. arbitrary remote html pages)
* is a security risk.
* Embedded scripts are run with the same level of system access available to dompdf.
* Set this option to false (recommended) if you wish to process untrusted documents.
* This setting may increase the risk of system exploit.
* Do not change this settings without understanding the consequences.
* Additional documentation is available on the dompdf wiki at:
* https://github.com/dompdf/dompdf/wiki
*
* @var bool
*/
'enable_php' => false,
/**
* Rnable inline JavaScript
*
* If this setting is set to true then DOMPDF will automatically insert JavaScript code contained
* within <script type="text/javascript"> ... </script> tags as written into the PDF.
* NOTE: This is PDF-based JavaScript to be executed by the PDF viewer,
* not browser-based JavaScript executed by Dompdf.
*
* @var bool
*/
'enable_javascript' => true,
/**
* Enable remote file access
*
* If this setting is set to true, DOMPDF will access remote sites for
* images and CSS files as required.
*
* ==== IMPORTANT ====
* This can be a security risk, in particular in combination with isPhpEnabled and
* allowing remote html code to be passed to $dompdf = new DOMPDF(); $dompdf->load_html(...);
* This allows anonymous users to download legally doubtful internet content which on
* tracing back appears to being downloaded by your server, or allows malicious php code
* in remote html pages to be executed by your server with your account privileges.
*
* This setting may increase the risk of system exploit. Do not change
* this settings without understanding the consequences. Additional
* documentation is available on the dompdf wiki at:
* https://github.com/dompdf/dompdf/wiki
*
* @var bool
*/
'enable_remote' => false,
/**
* List of allowed remote hosts
*
* Each value of the array must be a valid hostname.
*
* This will be used to filter which resources can be loaded in combination with
* isRemoteEnabled. If enable_remote is FALSE, then this will have no effect.
*
* Leave to NULL to allow any remote host.
*
* @var array|null
*/
'allowed_remote_hosts' => null,
/**
* A ratio applied to the fonts height to be more like browsers' line height
*/
'font_height_ratio' => 1.1,
/**
* Use the HTML5 Lib parser
*
* @deprecated This feature is now always on in dompdf 2.x
*
* @var bool
*/
'enable_html5_parser' => true,
],
];

80
config/filesystems.php Normal file
View File

@ -0,0 +1,80 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application for file storage.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
'report' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
'report' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'report' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

132
config/logging.php Normal file
View File

@ -0,0 +1,132 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

116
config/mail.php Normal file
View File

@ -0,0 +1,116 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send all email
| messages unless another mailer is explicitly specified when sending
| the message. All additional mailers can be configured within the
| "mailers" array. Examples of each type of mailer are provided.
|
*/
'default' => env('MAIL_MAILER', 'log'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers that can be used
| when delivering an email. You may specify which one you're using for
| your mailers below. You may also add additional mailers if needed.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "resend", "log", "array",
| "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'scheme' => env('MAIL_SCHEME'),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'ses' => [
'transport' => 'ses',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
// 'client' => [
// 'timeout' => 5,
// ],
],
'resend' => [
'transport' => 'resend',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all emails sent by your application to be sent from
| the same address. Here you may specify a name and address that is
| used globally for all emails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
];

112
config/queue.php Normal file
View File

@ -0,0 +1,112 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue supports a variety of backends via a single, unified
| API, giving you convenient access to each backend using identical
| syntax for each. The default queue connection is defined below.
|
*/
'default' => env('QUEUE_CONNECTION', 'database'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection options for every queue backend
| used by your application. An example configuration is provided for
| each backend supported by Laravel. You're also free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control how and where failed jobs are stored. Laravel ships with
| support for storing failed jobs in a simple file or in a database.
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
],
];

38
config/services.php Normal file
View File

@ -0,0 +1,38 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];

217
config/session.php Normal file
View File

@ -0,0 +1,217 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option determines the default session driver that is utilized for
| incoming requests. Laravel supports a variety of storage options to
| persist session data. Database storage is a great default choice.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'database'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to expire immediately when the browser is closed then you may
| indicate that via the expire_on_close configuration option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it's stored. All encryption is performed
| automatically by Laravel and you may use the session like normal.
|
*/
'encrypt' => env('SESSION_ENCRYPT', false),
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When utilizing the "file" session driver, the session files are placed
| on disk. The default storage location is defined here; however, you
| are free to provide another location where they should be stored.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table to
| be used to store sessions. Of course, a sensible default is defined
| for you; however, you're welcome to change this to another table.
|
*/
'table' => env('SESSION_TABLE', 'sessions'),
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using one of the framework's cache driven session backends, you may
| define the cache store which should be used to store the session data
| between requests. This must match one of your defined cache stores.
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the session cookie that is created by
| the framework. Typically, you should not need to change this value
| since doing so does not grant a meaningful security improvement.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application, but you're free to change this when necessary.
|
*/
'path' => env('SESSION_PATH', '/'),
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| This value determines the domain and subdomains the session cookie is
| available to. By default, the cookie will be available to the root
| domain and all subdomains. Typically, this shouldn't be changed.
|
*/
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. It's unlikely you should disable this option.
|
*/
'http_only' => env('SESSION_HTTP_ONLY', true),
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" to permit secure cross-site requests.
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => env('SESSION_SAME_SITE', 'lax'),
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
];

1
database/.gitignore vendored Normal file
View File

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

View File

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};

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('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

View File

@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};

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('product', function (Blueprint $table) {
$table->id();
$table->string('nama_produk');
$table->double('harga_beli');
$table->double('harga_jual');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('product');
}
};

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('laporan_pembelian', function (Blueprint $table) {
$table->id();
$table->date('tanggal');
$table->string('nama_supplier');
$table->string('nama_produk');
$table->double('harga_beli');
$table->double('jumlah');
$table->double('total');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('laporan_pembelian');
}
};

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('laporan_pembelian', function (Blueprint $table) {
$table->foreignId('id_product')->after('total')->constrained('product')->onDelete('cascade');
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_pembelian', function (Blueprint $table) {
$table->dropColumn(['id_product']);
//
});
}
};

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('laporan_pembelian', function (Blueprint $table) {
//
$table->foreignId('id_product')->after('total')->constrained('product')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_pembelian', function (Blueprint $table) {
//
$table->dropColumn(['id_product']);
});
}
};

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('table_laporan_pembelian', function (Blueprint $table) {
$table->id();
$table->date('tanggal');
$table->string('nama_pembeli');
$table->string('nama_produk');
$table->double('harga_jual');
$table->double('jumlah');
$table->double('total');
$table->foreignId('id_product')->constrained('product')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('table_laporan_pembelian');
}
};

View File

@ -0,0 +1,24 @@
<?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::rename('table_laporan_pembelian', 'laporan_penjualan');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::rename('laporan_penjualan', 'table_laporan_pembelian');
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('product', function (Blueprint $table) {
//
$table->integer('stok')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('product', function (Blueprint $table) {
//
});
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('laporan_penjualan', function (Blueprint $table) {
//
$table->double('harga_beli')->after('harga_jual');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_penjualan', function (Blueprint $table) {
//
});
}
};

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('surat_tugas', function (Blueprint $table) {
$table->id();
$table->string('nama');
$table->string('no_ktp');
$table->string('no_surat');
$table->string('alamat');
$table->date('tanggal');
$table->date('masa');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('surat_tugas');
}
};

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::table('laporan_penjualan', function (Blueprint $table) {
Schema::table('laporan_penjualan', function (Blueprint $table) {
$table->string('alamat')->after('nama_pembeli')->nullable();
$table->string('no_telepon')->after('alamat')->nullable();
});
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('laporan_penjualan', function (Blueprint $table) {
Schema::table('laporan_penjualan', function (Blueprint $table) {
$table->dropColumn(['alamat', 'no_telepon']);
});
});
}
};

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
//
Schema::create('surat_jalan', function (Blueprint $table) {
$table->id();
$table->date('tanggal');
$table->string('nama_penerima', 255);
$table->string('nama_produk', 100);
$table->string('jenis_kendaraan', 100);
$table->string('no_pol', 8);
$table->double('jumlah');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
Schema::dropIfExists('surat_jalan');
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('surat_jalan', function (Blueprint $table) {
//
$table->string('no_surat')->after('jumlah');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('surat_jalan', function (Blueprint $table) {
$table->dropColumn(['no_surat']);
});
}
};

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::table('surat_jalan', function (Blueprint $table) {
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('surat_jalan', function (Blueprint $table) {
$table->dropColumn(['timestamps']);
});
}
};

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('surat_jalan', function (Blueprint $table) {
//
$table->date('masa')->default(now())->after('tanggal');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('surat_jalan', function (Blueprint $table) {
$table->dropColumn(['masa']);
});
}
};

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('company', function (Blueprint $table) {
//
$table->id();
$table->string('company', 255);
$table->string('alamat_company', 255);
$table->string('no_telp', 15);
$table->string('owner', 100);
$table->string('email_company', 100);
$table->string('logo_company')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('company', function (Blueprint $table) {
//
Schema::dropIfExists('company');
});
}
};

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class LaporanPenjualanSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$data = [];
for ($i = 0; $i < 15; $i++) {
$data[] = [
'tanggal' => Carbon::now()->subDays(rand(1, 30)),
'nama_pembeli' => 'Pembeli ' . ($i + 1),
'nama_produk' => 'CPO',
'harga_jual' => rand(10000, 50000),
'jumlah' => rand(1, 10),
'total' => rand(100000, 500000),
'id_product' => 1,
'created_at' => now(),
'updated_at' => now(),
];
}
for ($i = 0; $i < 15; $i++) {
$data[] = [
'tanggal' => Carbon::now()->subDays(rand(1, 30)),
'nama_pembeli' => 'Pembeli ' . ($i + 16),
'nama_produk' => 'Jelantah Pak Tabrani',
'harga_jual' => rand(5000, 30000),
'jumlah' => rand(1, 10),
'total' => rand(50000, 300000),
'id_product' => 50,
'created_at' => now(),
'updated_at' => now(),
];
}
DB::table('laporan_penjualan')->insert($data);
}
}

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
"autoprefixer": "^10.4.20",
"axios": "^1.7.4",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.13",
"vite": "^6.0"
}
}

33
phpunit.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_STORE" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>

6
postcss.config.js Normal file
View File

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

25
public/.htaccess Normal file
View File

@ -0,0 +1,25 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Handle X-XSRF-Token Header
RewriteCond %{HTTP:x-xsrf-token} .
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

0
public/favicon1.ico Normal file
View File

17
public/index.php Normal file
View File

@ -0,0 +1,17 @@
<?php
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture());

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View File

@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 579.74 579.74"><defs><style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:6px;}</style></defs><line class="cls-1" x1="2.12" y1="2.12" x2="577.62" y2="577.62"/><line class="cls-1" x1="2.12" y1="577.62" x2="577.62" y2="2.12"/></svg>

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2030.6 546.3" style="enable-background:new 0 0 2030.6 546.3;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CED4DA;}
</style>
<g>
<path class="st0" d="M1045.4,269.1c-16.8,0-28.9,5.5-41.1,11.1v126.7c11.7,1.1,18.5,1.1,29.6,1.1c40.2,0,45.8-18.4,45.8-44.2v-60.5
C1079.7,284.3,1073.4,269.1,1045.4,269.1L1045.4,269.1z M778.1,262.2c-27.9,0-34.3,15.3-34.3,34.3v10.7h68.6v-10.7
C812.4,277.5,806,262.2,778.1,262.2z M260.4,394.1c0,15,7.1,22.8,22.7,22.8c16.8,0,26.7-5.5,39-11.1v-30.1h-36.7
C268,375.7,260.4,379,260.4,394.1L260.4,394.1z M1305.4,269.1c-28,0-37.7,15.3-37.7,34.3v69.4c0,19.1,9.7,34.4,37.7,34.4
c27.9,0,37.7-15.3,37.7-34.4v-69.4C1343,284.3,1333.3,269.1,1305.4,269.1z M123.3,471.8H41.1v-199H0v-68.6h41.1v-41.2
c0-55.9,23.2-89.2,89.1-89.2H185v68.6h-34.3c-25.7,0-27.3,9.6-27.3,27.5l-0.1,34.3h62.1l-7.3,68.6h-54.9L123.3,471.8L123.3,471.8z
M404.3,472.4h-68.5l-3-17.3c-31.3,17.3-59.2,20.1-77.6,20.1c-50.3,0-77-33.6-77-80c0-54.8,31.2-74.3,87-74.3H322V309
c0-28-3.2-36.2-46.2-36.2h-70.3l6.9-68.6h76.8c94.3,0,115,29.8,115,105.3L404.3,472.4L404.3,472.4z M637.3,277.9
c-42.6-7.3-54.9-8.9-75.4-8.9c-36.9,0-48,8.1-48,39.4v59.2c0,31.3,11.1,39.5,48,39.5c20.5,0,32.8-1.6,75.4-9V465
c-37.3,8.4-61.7,10.6-82.2,10.6c-88.3,0-123.4-46.4-123.4-113.5v-48c0-67.1,35.1-113.6,123.4-113.6c20.6,0,44.9,2.2,82.2,10.6
V277.9L637.3,277.9z M894.6,362H743.8v5.5c0,31.3,11.1,39.5,48,39.5c33.1,0,53.3-1.6,95.9-9V465c-41.1,8.4-62.4,10.6-102.7,10.6
c-88.3,0-123.4-46.4-123.4-113.5v-54.9c0-58.7,26-106.7,116.5-106.7s116.5,47.5,116.5,106.7V362z M1161.9,363.3
c0,64.8-18.5,112.1-130.7,112.1c-40.5,0-64.3-3.6-109-10.4V94.5l82.2-13.7v129.6c17.8-6.6,40.8-10,61.7-10
c82.2,0,95.9,36.9,95.9,96.1L1161.9,363.3L1161.9,363.3z M1425.3,364.7c0,55.9-23.1,110.1-119.7,110.1
c-96.6,0-120.1-54.2-120.1-110.1v-54c0-55.9,23.5-110.2,120.1-110.2c96.6,0,119.7,54.2,119.7,110.2V364.7L1425.3,364.7z
M1688.6,364.7c0,55.9-23.1,110.1-119.7,110.1c-96.6,0-120.1-54.2-120.1-110.1v-54c0-55.9,23.5-110.2,120.1-110.2
c96.6,0,119.7,54.2,119.7,110.2V364.7L1688.6,364.7z M1958.8,471.8h-89.1l-75.3-125.8v125.8h-82.2V94.5l82.2-13.7v242.9l75.3-119.4
h89.1l-82.3,130.3L1958.8,471.8z M1568.7,269.1c-27.9,0-37.6,15.3-37.6,34.3v69.4c0,19.1,9.7,34.4,37.6,34.4
c27.9,0,37.8-15.3,37.8-34.4v-69.4C1606.4,284.3,1596.6,269.1,1568.7,269.1L1568.7,269.1z M2005.7,424.9
c13.8,0,24.9,11.3,24.9,25.4c0,14.3-11,25.5-25,25.5c-13.9,0-25.1-11.2-25.1-25.5c0-14.1,11.3-25.4,25.1-25.4H2005.7z
M2005.6,428.9c-11.2,0-20.3,9.6-20.3,21.4c0,12.1,9.1,21.5,20.4,21.5c11.3,0.1,20.3-9.5,20.3-21.4c0-11.9-9-21.6-20.3-21.6H2005.6
z M2000.9,465.1h-4.5v-28.3c2.4-0.3,4.6-0.7,8-0.7c4.3,0,7.1,0.9,8.8,2.1c1.7,1.3,2.6,3.2,2.6,5.9c0,3.7-2.5,6-5.5,6.9v0.2
c2.5,0.5,4.2,2.7,4.7,6.9c0.7,4.4,1.3,6.1,1.8,7h-4.7c-0.7-0.9-1.4-3.5-1.9-7.2c-0.7-3.6-2.5-5-6.1-5h-3.1L2000.9,465.1
L2000.9,465.1z M2000.9,449.4h3.3c3.7,0,6.9-1.4,6.9-4.9c0-2.5-1.8-5-6.9-5c-1.5,0-2.5,0.1-3.3,0.2V449.4L2000.9,449.4z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2500 928" style="enable-background:new 0 0 2500 928;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CED4DA;}
</style>
<path class="st0" d="M307.9,112.1h22.2c77.2,1.7,153.1,32.7,207.6,87.7c-20.1,20.6-40.7,40.3-60.4,60.8
c-30.6-27.7-67.5-49.1-107.8-56.6c-59.6-12.6-123.7-1.3-173.7,32.7c-54.5,35.7-91.4,96.1-99.4,160.7c-8.8,63.8,9.2,130.9,50.8,180.4
c39.8,48.2,100.7,78.4,163.6,80.5c58.7,3.4,120-14.7,162.8-55.8c33.6-28.9,49.1-73,54.1-115.8c-69.6,0-139.3,0.4-208.9,0v-86.4H612
c15.1,92.7-6.7,197.1-77.2,263.4c-47,47-112,74.7-178.3,80.1c-64.2,6.3-130.5-5.9-187.5-36.9c-68.4-36.5-122.9-98.2-149.7-170.7
C-5.9,469.5-6.3,394,17.2,326.8c21.4-61.2,62.5-115.4,115.4-153.1C183.3,136.4,245,115.8,307.9,112.1z"/>
<path class="st0" d="M1989.9,133.9h89.8v599c-29.8,0-60,0.4-89.8-0.4C1990.4,533.2,1989.9,333.5,1989.9,133.9L1989.9,133.9z"/>
<path class="st0" d="M811.7,341.5C867,331,927,342.8,972.7,375.9c41.5,29.4,70.5,75.5,79.3,125.8c11.3,58.3-2.9,122.1-40.7,168.2
c-40.7,51.6-107.4,79.3-172.4,75.1c-59.6-3.4-117.4-33.1-152.7-81.8c-39.8-53.7-49.5-127.5-27.7-190.4
C680.4,405.3,742,353.7,811.7,341.5 M824.2,421.2c-22.7,5.9-43.6,18.9-58.7,37.3c-40.7,48.7-38.2,127.9,6.7,173.2
c25.6,26,64.2,38.2,99.8,31c33.1-5.9,62.1-28.1,78-57.5c27.7-49.9,19.7-118.7-22.7-157.7C900.2,422.5,860.3,412,824.2,421.2
L824.2,421.2z"/>
<path class="st0" d="M1256.3,341.5c63.3-12.2,132.6,5.5,179.9,49.9c77.2,69.2,85.6,198.8,19.7,278.5c-39.8,50.3-104.4,78-168.2,75.1
c-60.8-1.7-120.8-31.9-156.9-81.8c-40.7-54.9-49.5-130.5-26.4-194.6C1127.5,403.2,1187.9,353.3,1256.3,341.5 M1268.9,421.2
c-22.7,5.9-43.6,18.9-58.7,36.9c-40.3,47.8-38.6,125.8,4.6,171.6c25.6,27.3,65.4,40.7,102.3,33.1c32.7-6.3,62.1-28.1,78-57.5
c27.3-50.3,19.3-119.1-23.5-158.1C1344.4,422.1,1304.5,412,1268.9,421.2L1268.9,421.2z"/>
<path class="st0" d="M1633.4,365.8c48.2-30.2,112.4-38.6,164.4-12.6c16.4,7.1,29.8,19.3,42.8,31.5c0.4-11.3,0-23.1,0.4-34.8
c28.1,0.4,56.2,0,84.7,0.4v370c-0.4,55.8-14.7,114.9-54.9,155.6c-44,44.9-111.6,58.7-172.4,49.5c-65-9.6-121.6-57-146.8-117
c25.2-12.2,51.6-21.8,77.6-33.1c14.7,34.4,44.5,63.8,81.8,70.5c37.3,6.7,80.5-2.5,104.9-33.6c26-31.9,26-75.5,24.7-114.5
c-19.3,18.9-41.5,35.7-68.4,41.9c-58.3,16.4-122.5-3.8-167.4-43.2c-45.3-39.4-72.1-100.3-69.6-160.7
C1536.5,467.4,1575.1,401.5,1633.4,365.8 M1720.2,419.5c-25.6,4.2-49.5,18.5-65.9,38.2c-39.4,47-39.4,122.1,0.4,168.2
c22.7,27.3,59.1,42.4,94.4,38.6c33.1-3.4,63.8-24.3,80.1-53.3c27.7-49.1,23.1-115.8-14.3-158.6
C1791.9,426.2,1755,413.2,1720.2,419.5L1720.2,419.5z"/>
<path class="st0" d="M2187.5,387.2c50.3-47,127.9-62.9,192.5-38.2c61.2,23.1,100.3,81.4,120,141.4c-91,37.8-181.6,75.1-272.7,112.8
c12.6,23.9,31.9,45.7,57.9,54.5c36.5,13,80.1,8.4,110.7-15.9c12.2-9.2,21.8-21.4,31-33.1c23.1,15.5,46.1,30.6,69.2,46.1
c-32.7,49.1-87.7,83.5-146.8,88.9c-65.4,8-135.1-17.2-177.4-68.4C2102.3,594.9,2109.1,459.8,2187.5,387.2 M2232.4,464.8
c-14.3,20.6-20.1,45.7-19.7,70.5c60.8-25.2,121.6-50.3,182.5-75.9c-10.1-23.5-34.4-37.8-59.1-41.5
C2296.1,410.7,2254.6,432.1,2232.4,464.8z"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2500 1000" style="enable-background:new 0 0 2500 1000;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CED4DA;}
</style>
<path class="st0" d="M0,0v68.4h486.6V0H0z M555.6,0v68.4H1249c0,0-70.8-68.4-164.6-68.4H555.6z M1385.1,0v68.4h419.5L1779.7,0
H1385.1z M2105.4,0l-24.9,68.4h415.7V0H2105.4z M0,133.1v68.4h486.6v-68.4H0z M555.6,133.2v68.3h773.9c0,0-9-52.7-24.8-68.3
L555.6,133.2L555.6,133.2z M1385.1,133.2v68.3h465.5l-23-68.3L1385.1,133.2L1385.1,133.2z M2055.6,133.2l-23,68.3h463.7v-68.3
H2055.6z M139.8,266.1v68.5h210.7v-68.5L139.8,266.1L139.8,266.1z M695.4,266.1v68.5h210.7v-68.5L695.4,266.1L695.4,266.1z
M1111.1,266.1v68.5h210.7c0,0,13.4-36.2,13.4-68.5L1111.1,266.1L1111.1,266.1z M1524.9,266.1v68.5h373.6l-24.9-68.5L1524.9,266.1
L1524.9,266.1z M2009.7,266.1l-25,68.5h375.5v-68.5L2009.7,266.1L2009.7,266.1z M139.8,399.3v68.4h210.7v-68.4H139.8L139.8,399.3z
M695.4,399.3v68.4h538.3c0,0,45-35.1,59.4-68.4H695.4z M1524.9,399.3v68.4h210.7v-38.1l13.4,38.1h386l14.4-38.1v38.1h210.7v-68.4
h-395.6l-21,57.9l-21.1-57.9H1524.9z M139.8,532.3v68.4h210.7v-68.4H139.8z M695.4,532.3v68.4h597.7c-14.3-33.2-59.4-68.4-59.4-68.4
H695.4z M1524.9,532.3v68.4h210.7v-68.4H1524.9z M1773.9,532.3l25.5,68.4h289.5l24.2-68.4H1773.9z M2149.4,532.3v68.4h210.7v-68.4
H2149.4z M139.8,665.4v68.4h210.7v-68.4H139.8z M695.4,665.4v68.4h210.7v-68.4H695.4z M1111.1,665.4v68.4h224.1
c0-32.3-13.4-68.4-13.4-68.4H1111.1L1111.1,665.4z M1524.9,665.4v68.4h210.7v-68.4H1524.9z M1821.8,665.4l24.7,68.4h194l24.9-68.4
H1821.8z M2149.4,665.4v68.4h210.7v-68.4H2149.4z M3.8,798.4v68.5h486.6v-68.5H3.8z M555.6,798.4v68.5h749.1
c15.8-15.7,24.8-68.5,24.8-68.5H555.6L555.6,798.4z M1388.9,798.4v68.5h346.8v-68.5H1388.9z M1869.7,798.4l25.4,68.5h98.7l23.8-68.5
H1869.7z M2149.4,798.4v68.5H2500v-68.5H2149.4z M3.8,931.6v68.4h486.6v-68.4H3.8z M555.6,931.6v68.3h528.8
c93.8,0,164.6-68.3,164.6-68.3H555.6z M1388.9,931.6v68.4h346.8v-68.4H1388.9z M1917.9,931.6l24.4,68.2l4.2,0.1l24.8-68.3H1917.9z
M2149.4,931.6v68.4H2500v-68.4H2149.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2500 534" style="enable-background:new 0 0 2500 534;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CED4DA;}
</style>
<path class="st0" d="M2500,241.6v-44h-54.6v-68.4l-1.8,0.6l-51.3,15.7l-1,0.3v51.8h-80.9v-28.9c0-13.4,3-23.7,8.9-30.6
c5.9-6.8,14.3-10.2,25-10.2c7.7,0,15.7,1.8,23.7,5.4l2,0.9V88l-0.9-0.3c-7.5-2.7-17.7-4.1-30.3-4.1c-15.9,0-30.4,3.5-43,10.3
c-12.6,6.9-22.6,16.7-29.5,29.2c-6.9,12.5-10.5,26.9-10.5,42.8v31.7h-38v44h38v185.2h54.6V241.6h80.9v117.7c0,48.5,22.9,73,68,73
c7.4,0,15.2-0.9,23.2-2.6c8.1-1.7,13.6-3.5,16.9-5.4l0.7-0.4v-44.4l-2.2,1.5c-3,2-6.7,3.6-11,4.8c-4.3,1.2-8,1.8-10.8,1.8
c-10.6,0-18.4-2.8-23.2-8.5c-4.9-5.7-7.4-15.6-7.4-29.4V241.6H2500L2500,241.6z M2095.9,387.7c-19.8,0-35.4-6.6-46.4-19.5
c-11.1-13-16.7-31.5-16.7-55.1c0-24.3,5.6-43.3,16.7-56.6c11-13.1,26.5-19.8,46-19.8c18.9,0,34,6.4,44.8,19
c10.8,12.6,16.3,31.5,16.3,56.1c0,24.9-5.2,44-15.4,56.8C2131,381.3,2115.8,387.7,2095.9,387.7 M2098.3,192.1
c-37.8,0-67.8,11.1-89.2,32.9c-21.4,21.8-32.2,52.1-32.2,89.9c0,35.9,10.6,64.7,31.5,85.8c20.9,21,49.3,31.7,84.5,31.7
c36.6,0,66.1-11.2,87.4-33.4c21.4-22.1,32.2-52.1,32.2-89c0-36.4-10.2-65.5-30.2-86.4C2162.1,202.7,2133.9,192.1,2098.3,192.1
M1888.8,192.1c-25.7,0-47,6.6-63.2,19.5c-16.3,13-24.6,30.1-24.6,50.8c0,10.8,1.8,20.3,5.3,28.4c3.5,8.1,9,15.3,16.3,21.3
c7.2,6,18.4,12.2,33.2,18.6c12.4,5.1,21.7,9.4,27.6,12.9c5.8,3.3,9.8,6.7,12.1,10c2.2,3.2,3.4,7.6,3.4,13
c0,15.4-11.5,22.9-35.3,22.9c-8.8,0-18.8-1.8-29.8-5.5c-10.9-3.6-21.2-8.8-30.6-15.5l-2.3-1.6v52.5l0.8,0.4
c7.7,3.6,17.5,6.6,28.9,8.9c11.5,2.4,21.9,3.6,30.9,3.6c27.9,0,50.4-6.6,66.8-19.6c16.5-13.1,24.9-30.6,24.9-52.1
c0-15.4-4.5-28.7-13.4-39.4c-8.8-10.6-24.1-20.3-45.4-28.9c-17-6.8-27.9-12.5-32.4-16.8c-4.3-4.2-6.5-10.1-6.5-17.7
c0-6.7,2.7-12,8.3-16.3c5.6-4.3,13.4-6.6,23.2-6.6c9.1,0,18.4,1.4,27.6,4.3c9.2,2.8,17.4,6.6,24.1,11.2l2.2,1.5v-49.8l-0.9-0.4
c-6.3-2.7-14.5-5-24.5-6.8C1905.8,193,1896.7,192.1,1888.8,192.1 M1658.7,387.7c-19.8,0-35.4-6.6-46.4-19.5
c-11.1-13-16.7-31.5-16.7-55.1c0-24.3,5.6-43.3,16.7-56.6c11-13.1,26.5-19.8,46-19.8c18.9,0,34,6.4,44.8,19
c10.8,12.6,16.3,31.5,16.3,56.1c0,24.9-5.2,44-15.4,56.8C1693.9,381.3,1678.7,387.7,1658.7,387.7 M1661.2,192.1
c-37.8,0-67.8,11.1-89.2,32.9c-21.4,21.8-32.2,52.1-32.2,89.9c0,35.9,10.6,64.7,31.5,85.8c20.9,21,49.3,31.7,84.5,31.7
c36.6,0,66.1-11.2,87.4-33.4c21.4-22.1,32.2-52.1,32.2-89c0-36.4-10.2-65.5-30.2-86.4C1725,202.7,1696.7,192.1,1661.2,192.1
M1456.9,237.3v-39.7h-53.9v229.2h53.9V309.6c0-19.9,4.5-36.3,13.4-48.7c8.8-12.2,20.5-18.4,34.9-18.4c4.9,0,10.3,0.8,16.2,2.4
c5.8,1.6,10.1,3.3,12.6,5.1l2.3,1.6v-54.4l-0.9-0.4c-5-2.1-12.1-3.2-21.1-3.2c-13.5,0-25.7,4.4-36.1,12.9
c-9.1,7.5-15.7,17.9-20.7,30.7H1456.9z M1306.4,192.1c-24.7,0-46.8,5.3-65.6,15.8c-18.8,10.5-33.3,25.4-43.2,44.5
c-9.9,19-14.9,41.1-14.9,65.9c0,21.7,4.8,41.5,14.4,59c9.6,17.5,23.2,31.3,40.3,40.8c17.2,9.5,37,14.3,58.9,14.3
c25.6,0,47.5-5.1,65-15.2l0.7-0.4v-49.4l-2.3,1.7c-7.9,5.8-16.8,10.4-26.4,13.7c-9.5,3.3-18.2,5-25.8,5c-21.2,0-38.1-6.6-50.5-19.7
c-12.4-13.1-18.6-31.4-18.6-54.5c0-23.2,6.5-42.1,19.4-55.9c12.8-13.8,29.8-20.9,50.6-20.9c17.7,0,35,6,51.3,17.9l2.3,1.6v-52
l-0.7-0.4c-6.1-3.4-14.5-6.3-24.9-8.4C1326.2,193.2,1316,192.1,1306.4,192.1 M1145.6,197.6h-53.9v229.2h53.9V197.6L1145.6,197.6z
M1119.2,100c-8.9,0-16.6,3-23,9c-6.4,6-9.6,13.6-9.6,22.5c0,8.8,3.2,16.2,9.5,22c6.3,5.8,14,8.8,23.1,8.8c9,0,16.8-3,23.2-8.8
c6.4-5.9,9.6-13.3,9.6-22.1c0-8.6-3.2-16.1-9.4-22.2C1136.4,103.1,1128.6,100,1119.2,100 M984.7,180.7v246.1h55V107h-76.1
l-96.8,237.5L772.9,107h-79.2v319.8h51.7V180.7h1.8l99.2,246.1h39l97.6-246.1L984.7,180.7L984.7,180.7z"/>
<path class="st0" d="M253.6,253.7H0V0.1h253.6V253.7z"/>
<path class="st0" d="M533.6,253.7H280V0.1h253.6L533.6,253.7L533.6,253.7z"/>
<path class="st0" d="M253.6,533.9H0V280.3h253.6V533.9z"/>
<path class="st0" d="M533.6,533.9H280V280.3h253.6L533.6,533.9L533.6,533.9z"/>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

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