This commit is contained in:
zidan 2024-07-03 15:00:39 +07:00
commit 2598d17e62
18704 changed files with 2092277 additions and 0 deletions

View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4

53
bangunan testing/.env Normal file
View File

@ -0,0 +1,53 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:1hWWCHAxccLrVyJglZNmV+LqQmBnEMCaWWrR4bFsEuQ=
APP_DEBUG=true
APP_URL=http://localhost
APP_FORCE_HTTPS=true
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=testing
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_USERNAME=wahanaartaperdana@gmail.com
MAIL_PASSWORD="rpwa ktai ctmf lrvm"
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="wahanaartaperdana@gmail.com"
MAIL_FROM_NAME="KSP Wahana Arta Perdana"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=auto
AWS_BUCKET=cdn-progriva
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

View File

@ -0,0 +1,52 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

View File

@ -0,0 +1,8 @@
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

View File

@ -0,0 +1,14 @@
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true

View File

View File

@ -0,0 +1,540 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 20, 2024 at 08:43 PM
-- Server version: 8.0.30
-- PHP Version: 8.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `akunansi_baru`
--
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint UNSIGNED NOT NULL,
`uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `log_activites`
--
CREATE TABLE `log_activites` (
`id` bigint UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int UNSIGNED NOT NULL,
`migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2023_07_08_072603_create_websites_table', 2),
(6, '2023_09_05_073014_create_log_activites_table', 2),
(7, '2024_05_21_093802_add_kode_transaksi_to_tbl_transaksi_table', 2),
(8, '2024_05_21_202127_create_suppliers_table', 2),
(9, '2024_05_25_115057_add_payment_method_to_tbl_transaksi', 3);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`isUsed` int NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `password_resets`
--
INSERT INTO `password_resets` (`uuid`, `email`, `token`, `isUsed`, `created_at`) VALUES
('2a16b010-a96a-4d16-b579-52dc50f3ff89', 'yonatanagave@gmail.com', '976871b0646b2c055ffc6a6408048ba6', 0, '2023-12-28 14:56:29'),
('74f0ae01-1d0f-487a-b4bd-49d91dd1783b', 'officialnuzulzaif124@gmail.com', '985a92a858cec0a0c8024444af20f01c', 0, '2024-04-02 13:58:33'),
('8c40d1a7-a6c8-4d05-9ffa-08be157e4261', 'officialnuzulzaif124@gmail.com', 'f915b09ae1f430cc98b9942dfa470480', 0, '2024-04-02 14:03:16'),
('ddf0b068-d7a7-4d84-bdcc-db2ad60dcef1', 'localvalorants@gmail.com', '27e668f86a14cc8d4eb980ccc430888e', 1, '2023-09-18 07:05:45'),
('ed5ec1c1-b9a8-4b2c-8c9f-91811dcf3aa1', 'localvalorants@gmail.com', '33790bd44168c13461111d0e9de6a8ee', 0, '2023-09-19 06:17:59'),
('f63c96d5-7f55-4da2-baf6-c3412d7e023c', 'officialnuzulzaif124@gmail.com', '4a81a4838bfb11fb29345021ea8cf23c', 0, '2024-04-02 13:53:34');
-- --------------------------------------------------------
--
-- Table structure for table `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint UNSIGNED NOT NULL,
`tokenable_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint UNSIGNED NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `suppliers`
--
CREATE TABLE `suppliers` (
`id` bigint UNSIGNED NOT NULL,
`nama_supplier` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nama_produk` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`jumlah` int NOT NULL,
`harga` decimal(15,2) NOT NULL,
`payment_method` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `suppliers`
--
INSERT INTO `suppliers` (`id`, `nama_supplier`, `nama_produk`, `jumlah`, `harga`, `payment_method`, `created_at`, `updated_at`) VALUES
(29, 'Pak Yudi', 'Kayu Kelapa 8x12 (5 meter)', 8, '90000.00', 'cash', '2024-05-31 22:52:07', '2024-05-31 22:52:07'),
(30, 'Pt tongas abadi', 'kayu Reng 2x3 (3 meter) (25 biji)', 3, '70000.00', 'hutang', '2024-05-31 22:52:31', '2024-05-31 22:52:31'),
(31, 'Pak Yudi', 'Kayu Kelapa 8x12 (5 meter)', 9, '100000.00', 'cash', '2024-06-03 04:18:02', '2024-06-03 04:18:02'),
(32, 'Pak Ely', 'Kayu Kelapa 8x12 (5 meter)', 15, '15000.00', 'hutang', '2024-06-03 04:38:03', '2024-06-03 04:38:03');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_akun`
--
CREATE TABLE `tbl_akun` (
`id` int NOT NULL,
`nama_akun` varchar(100) DEFAULT NULL,
`kode_akun` varchar(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_akun`
--
INSERT INTO `tbl_akun` (`id`, `nama_akun`, `kode_akun`) VALUES
(1, 'Kas', '110'),
(2, 'Piutang Usaha', '120'),
(3, 'Persediaan', '140'),
(9, 'Pendapatan Penjualan', '510'),
(14, 'Hutang Usaha', '113');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_jurnal`
--
CREATE TABLE `tbl_jurnal` (
`id` int NOT NULL,
`no_reff` varchar(255) NOT NULL,
`keterangan` varchar(255) DEFAULT NULL,
`waktu_transaksi` date DEFAULT NULL,
`nominal` int UNSIGNED DEFAULT NULL,
`tipe` enum('d','k') DEFAULT NULL,
`id_akun` int UNSIGNED DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_jurnal`
--
INSERT INTO `tbl_jurnal` (`id`, `no_reff`, `keterangan`, `waktu_transaksi`, `nominal`, `tipe`, `id_akun`, `created_at`, `updated_at`) VALUES
(96, 's6UtIr4FUP', 'Pembelian persediaan dari supplier Pak Yudi', '2024-06-01', 720000, 'd', 3, '2024-06-01 05:52:07', '2024-06-01 05:52:07'),
(97, 's6UtIr4FUP', 'Pembayaran tunai untuk pembelian persediaan dari supplier Pak Yudi', '2024-06-01', 720000, 'k', 1, '2024-06-01 05:52:07', '2024-06-01 05:52:07'),
(98, 'MsUY5e2Dzr', 'Pembelian persediaan dari supplier Pt tongas abadi', '2024-06-01', 210000, 'd', 3, '2024-06-01 05:52:31', '2024-06-01 05:52:31'),
(99, 'MsUY5e2Dzr', 'Hutang untuk pembelian persediaan dari supplier Pt tongas abadi', '2024-06-01', 210000, 'k', 14, '2024-06-01 05:52:31', '2024-06-01 05:52:31'),
(100, 'Lz2ffGMzVI', 'Pembelian Kayu Kelapa 8x12 (5 meter)', '2024-06-01', 600000, 'd', 1, '2024-06-01 05:53:05', '2024-06-01 05:53:05'),
(101, 'Lz2ffGMzVI', 'Pembayaran Kayu Kelapa 8x12 (5 meter)', '2024-06-01', 600000, 'k', 9, '2024-06-01 05:53:05', '2024-06-01 05:53:05'),
(102, 'gu61iBA0Qr', 'Pembelian kayu Reng 2x3 (3 meter) (25 biji)', '2024-06-01', 900000, 'd', 1, '2024-06-01 05:53:17', '2024-06-01 05:53:17'),
(103, 'gu61iBA0Qr', 'Pembayaran kayu Reng 2x3 (3 meter) (25 biji)', '2024-06-01', 900000, 'k', 9, '2024-06-01 05:53:17', '2024-06-01 05:53:17'),
(104, 'rzO7zgzdPQ', 'Pembelian Kayu Kelapa 8x12 (5 meter)', '2024-06-01', 200000, 'd', 2, '2024-06-01 05:53:29', '2024-06-01 05:53:29'),
(105, 'rzO7zgzdPQ', 'Pembayaran Kayu Kelapa 8x12 (5 meter)', '2024-06-01', 200000, 'k', 9, '2024-06-01 05:53:29', '2024-06-01 05:53:29'),
(106, 'FkHRYrfRvw', 'Pembelian Kayu Kelapa 8x12 (5 meter)', '2024-06-03', 200000, 'd', 1, '2024-06-03 11:16:35', '2024-06-03 11:16:35'),
(107, 'FkHRYrfRvw', 'Pembayaran Kayu Kelapa 8x12 (5 meter)', '2024-06-03', 200000, 'k', 9, '2024-06-03 11:16:35', '2024-06-03 11:16:35'),
(108, 'CO28dIHuIc', 'Pembelian persediaan dari supplier Pak Yudi', '2024-06-03', 900000, 'd', 3, '2024-06-03 11:18:02', '2024-06-03 11:18:02'),
(109, 'CO28dIHuIc', 'Pembayaran tunai untuk pembelian persediaan dari supplier Pak Yudi', '2024-06-03', 900000, 'k', 1, '2024-06-03 11:18:02', '2024-06-03 11:18:02'),
(110, 'yZNabk4v71', 'Pembelian persediaan dari supplier Pak Ely', '2024-06-03', 225000, 'd', 3, '2024-06-03 11:38:03', '2024-06-03 11:38:03'),
(111, 'yZNabk4v71', 'Hutang untuk pembelian persediaan dari supplier Pak Ely', '2024-06-03', 225000, 'k', 14, '2024-06-03 11:38:03', '2024-06-03 11:38:03');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_log_activity`
--
CREATE TABLE `tbl_log_activity` (
`uid` char(40) NOT NULL,
`logType` int NOT NULL DEFAULT '1' COMMENT '1: Login\r\n2: General',
`causedBy` int NOT NULL,
`performedOn` varchar(50) NOT NULL,
`withContent` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_log_activity`
--
INSERT INTO `tbl_log_activity` (`uid`, `logType`, `causedBy`, `performedOn`, `withContent`, `created_at`) VALUES
('04270d70-eb96-469e-826b-f13970842025', 1, 1, '2024-05-29 23:01:02', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36\",\"time\":\"2024-05-29 23:01:02\"}', '2024-05-29 23:01:02'),
('0713b192-db5a-423d-a76f-249dd50895d4', 1, 1, '2024-05-30 00:01:04', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-30 00:01:04\"}', '2024-05-30 00:01:04'),
('09d11538-6034-45f6-9500-c080e27f36c3', 1, 1, '2024-06-01 05:19:48', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-01 05:19:48\"}', '2024-06-01 05:19:48'),
('1d6723ef-3465-49bf-afa4-6cdabfdeb534', 1, 1, '2024-05-28 10:38:55', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-28 10:38:55\"}', '2024-05-28 10:38:55'),
('3811ca4a-e642-4697-b9d8-3ca9f8278bf8', 1, 1, '2024-05-26 22:55:29', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-26 22:55:29\"}', '2024-05-26 22:55:29'),
('49927ef8-9114-4394-8ea9-05e0475ae415', 1, 1, '2024-06-03 01:29:37', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-03 01:29:37\"}', '2024-06-03 01:29:37'),
('521e99d3-cf1c-4be0-bab2-fda7da27f2c9', 1, 1, '2024-05-31 07:38:22', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-31 07:38:22\"}', '2024-05-31 07:38:22'),
('5adfe78d-3e27-46e9-8ff3-721e3c0d3b22', 1, 1, '2024-05-27 11:15:36', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-27 11:15:35\"}', '2024-05-27 11:15:36'),
('5c3e6063-6316-4762-9ee7-c9c6577fa655', 1, 1, '2024-06-03 06:32:17', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-03 06:32:17\"}', '2024-06-03 06:32:17'),
('63c66fca-b55a-4b04-9f3b-e7732704a0df', 1, 1, '2024-05-31 05:14:19', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-31 05:14:19\"}', '2024-05-31 05:14:19'),
('7500b6ac-2957-4381-b644-153c1c94b1a3', 1, 1, '2024-06-03 06:24:28', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-03 06:24:28\"}', '2024-06-03 06:24:28'),
('7b35a812-de97-49f0-a7b1-1b990ef40e04', 1, 2, '2024-05-25 11:22:49', '{\"status\":\"add\",\"text\":\"Login as Muhammad Zidan Prasetyo\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-25 11:22:49\"}', '2024-05-25 11:22:49'),
('99da6b29-153f-4f98-804c-d20f440148ce', 1, 1, '2024-05-21 20:40:24', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-21 20:40:24\"}', '2024-05-21 20:40:24'),
('9f08a731-d34a-480a-9fc0-5f24c44de928', 1, 1, '2024-06-03 10:58:57', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-03 10:58:57\"}', '2024-06-03 10:58:57'),
('a702df4c-a565-4f67-8f48-e1491537c5a7', 1, 1, '2024-05-27 22:48:08', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-27 22:48:07\"}', '2024-05-27 22:48:08'),
('ad74772c-6fed-4df8-a655-63e9fa9fa00e', 1, 1, '2024-05-31 19:04:20', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-31 19:04:20\"}', '2024-05-31 19:04:20'),
('aeae2a7f-c89b-4d8b-8656-ea4b99c7a5a2', 1, 1, '2024-05-31 13:53:50', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-31 13:53:50\"}', '2024-05-31 13:53:50'),
('b9b99746-d777-43e2-8b8a-8c3633769736', 1, 1, '2024-05-22 06:06:17', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-22 06:06:16\"}', '2024-05-22 06:06:17'),
('c3eca9ae-c11f-4115-99ca-bb1261ddcc7e', 1, 1, '2024-05-26 09:06:08', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-26 09:06:08\"}', '2024-05-26 09:06:08'),
('d3d07638-8691-4044-a240-5a4d8ca9b66f', 1, 1, '2024-05-22 19:26:57', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-22 19:26:57\"}', '2024-05-22 19:26:57'),
('d4598a65-e6b5-440c-8d98-da7ad591ff81', 1, 1, '2024-05-27 07:38:43', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-27 07:38:43\"}', '2024-05-27 07:38:43'),
('e8970f69-8e8d-4ea9-8f03-b27dbd0308a2', 1, 1, '2024-05-28 06:55:22', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-05-28 06:55:22\"}', '2024-05-28 06:55:22'),
('ee8db0db-9f80-4166-a09a-22e73d094ba7', 1, 1, '2024-06-03 10:22:44', '{\"status\":\"add\",\"text\":\"Login as Administrator\",\"ip_address\":\"127.0.0.1\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/125.0.0.0 Safari\\/537.36 Edg\\/125.0.0.0\",\"time\":\"2024-06-03 10:22:44\"}', '2024-06-03 10:22:44');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_produk`
--
CREATE TABLE `tbl_produk` (
`id` int NOT NULL,
`name` varchar(255) NOT NULL,
`stok` int NOT NULL,
`price` double NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_produk`
--
INSERT INTO `tbl_produk` (`id`, `name`, `stok`, `price`, `created_at`, `updated_at`) VALUES
(12, 'Kayu Kelapa 8x12 (5 meter)', 28, 100000, '2024-05-31 07:57:15', '2024-06-03 11:38:03'),
(13, 'kayu Reng 2x3 (3 meter) (25 biji)', 10, 100000, '2024-05-31 19:06:34', '2024-06-01 05:53:17');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_role`
--
CREATE TABLE `tbl_role` (
`id` int NOT NULL,
`name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_role`
--
INSERT INTO `tbl_role` (`id`, `name`) VALUES
(1, 'Administrator'),
(2, 'User');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_transaksi`
--
CREATE TABLE `tbl_transaksi` (
`id` int NOT NULL,
`id_product` int NOT NULL,
`qty` int NOT NULL,
`total` double NOT NULL,
`payment_method` varchar(255) NOT NULL DEFAULT 'cash',
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_transaksi`
--
INSERT INTO `tbl_transaksi` (`id`, `id_product`, `qty`, `total`, `payment_method`, `created_at`, `updated_at`) VALUES
(34, 12, 6, 600000, 'cash', '2024-06-01 05:53:05', '2024-06-01 05:53:05'),
(35, 13, 9, 900000, 'cash', '2024-06-01 05:53:17', '2024-06-01 05:53:17'),
(36, 12, 2, 200000, 'hutang', '2024-06-01 05:53:29', '2024-06-01 05:53:29'),
(37, 12, 2, 200000, 'cash', '2024-06-03 11:16:35', '2024-06-03 11:16:35');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_users`
--
CREATE TABLE `tbl_users` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`email_verified_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`level` int DEFAULT '3',
`phone` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`status` int NOT NULL DEFAULT '3' COMMENT '1: Active, 2: Non Active, 3: Deactivated, 4: Not Verified',
`thumbnail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_users`
--
INSERT INTO `tbl_users` (`id`, `name`, `username`, `email`, `email_verified_at`, `email_verified_token`, `password`, `level`, `phone`, `status`, `thumbnail`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Administrator', 'admin', 'admin@tugas.com', NULL, NULL, '$2y$10$/326LL0MKwXcpSG9hVQlkuSrhQHnVkH6cB2Pvqi7VidQhcZQbqJQi', 1, NULL, 1, '', NULL, '2022-06-09 23:01:32', '2024-03-25 05:36:47'),
(2, 'Muhammad Zidan Prasetyo', 'test664', 'test@example.com', NULL, NULL, '$2y$10$ibR1GlQ6LfcghInmVf8HCOFmFC.2f6Hley7PzeOFEWDmH3wXWEuUa', 1, NULL, 1, NULL, NULL, '2024-05-25 04:22:41', '2024-05-25 04:22:41');
-- --------------------------------------------------------
--
-- Table structure for table `websites`
--
CREATE TABLE `websites` (
`id` bigint UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `log_activites`
--
ALTER TABLE `log_activites`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD PRIMARY KEY (`uuid`),
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_akun`
--
ALTER TABLE `tbl_akun`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_jurnal`
--
ALTER TABLE `tbl_jurnal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_log_activity`
--
ALTER TABLE `tbl_log_activity`
ADD PRIMARY KEY (`uid`);
--
-- Indexes for table `tbl_produk`
--
ALTER TABLE `tbl_produk`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_role`
--
ALTER TABLE `tbl_role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_transaksi`
--
ALTER TABLE `tbl_transaksi`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_users`
--
ALTER TABLE `tbl_users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_username_unique` (`username`);
--
-- Indexes for table `websites`
--
ALTER TABLE `websites`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `log_activites`
--
ALTER TABLE `log_activites`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `tbl_akun`
--
ALTER TABLE `tbl_akun`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `tbl_jurnal`
--
ALTER TABLE `tbl_jurnal`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=112;
--
-- AUTO_INCREMENT for table `tbl_produk`
--
ALTER TABLE `tbl_produk`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `tbl_role`
--
ALTER TABLE `tbl_role`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_transaksi`
--
ALTER TABLE `tbl_transaksi`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
--
-- AUTO_INCREMENT for table `tbl_users`
--
ALTER TABLE `tbl_users`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `websites`
--
ALTER TABLE `websites`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -0,0 +1,45 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Modules\Seller\Entities\PaymentModel as Payment;
use App\Enums\GlobalEnum as Status;
class DepositCommand extends Command
{
protected $signature = 'deposit:update';
protected $description = 'Update status in deposit every minutes';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$orders = Payment::where('is_status', Status::isDepositPending)->get(); // Sesuaikan dengan logika pengambilan data
$currentTimestamp = time(); // Get the current timestamp
foreach ($orders as $order) {
$createdAtTimestamp = strtotime($order->created_at);
// Add 3 days to the creation date timestamp
$expiryTimestamp = $createdAtTimestamp + (3 * 24 * 60 * 60); // 3 days in seconds
// Compare the expiry timestamp with the current timestamp
$isExpired = $expiryTimestamp < $currentTimestamp;
$expired = $isExpired ? true : false;
if($expired == true) {
$findOrder = Payment::find($order->id);
$findOrder->is_status = Status::isDepositCancel;
// save
$findOrder->save();
}
}
$this->info('Status updated successfully!');
}
}

View File

@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Modules\User\Entities\OrderModel as Order;
use App\Enums\GlobalEnum as Status;
class OrdersCommand extends Command
{
protected $signature = 'orders:update';
protected $description = 'Update status in orders every minutes';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$orders = Order::where('is_status', Status::isOrderRequested)->get(); // Sesuaikan dengan logika pengambilan data
$currentTimestamp = time(); // Get the current timestamp
foreach ($orders as $order) {
$createdAtTimestamp = strtotime($order->created_at);
// Add 3 days to the creation date timestamp
$expiryTimestamp = $createdAtTimestamp + (3 * 24 * 60 * 60); // 3 days in seconds
// Compare the expiry timestamp with the current timestamp
$isExpired = $expiryTimestamp < $currentTimestamp;
$expired = $isExpired ? true : false;
if($expired == true) {
$findOrder = Order::find($order->id);
$findOrder->is_status = Status::isOrderCancelled;
$findOrder->last_buyer_message = 'Dibatalkan secara otomatis oleh sistem karena melebihi batas waktu 3 hari reseller tidak menanggapi permintaan pesanan';
$findOrder->cancel_reason = 'Dibatalkan secara otomatis oleh sistem karena melebihi batas waktu 3 hari reseller tidak menanggapi permintaan pesanan';
// save
$findOrder->save();
}
}
$this->info('Status updated successfully!');
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Modules\Seller\Entities\PaymentModel as Payment;
use Modules\Seller\Entities\AccountModel as User;
use App\Enums\GlobalEnum as Status;
class RealtimeDepositCommand extends Command
{
protected $signature = 'realtime-deposit:update';
protected $description = 'Update status in deposit every minutes';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$orders = Payment::where('is_status', Status::isDepositPending)->get(); // Sesuaikan dengan logika pengambilan data
$currentTimestamp = time(); // Get the current timestamp
foreach ($orders as $order) {
$merchantCode = app_info('duitku_merchant');
$apiKey = app_info('duitku_client');
$merchantOrderId = $order->deposit_number; // dari anda (merchant), bersifat unik
$signature = md5($merchantCode . $merchantOrderId . $apiKey);
$params = array(
'merchantCode' => $merchantCode,
'merchantOrderId' => $merchantOrderId,
'signature' => $signature
);
$params_string = json_encode($params);
if(app_info('duitku_sandbox') == 1) {
$url = 'https://sandbox.duitku.com/webapi/api/merchant/transactionStatus'; // Sandbox
} else {
$url = 'https://passport.duitku.com/webapi/api/merchant/transactionStatus'; // Production
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $params_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($params_string))
);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//execute post
$request = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($httpCode == 200)
{
$results = json_decode($request, true);
if($results['statusCode'] == 02) {
$findOrder = Payment::find($order->id);
$findOrder->is_status = Status::isDepositCancel;
$findOrder->urlRedirect = NULL;
// save
$findOrder->save();
} elseif($results['statusCode'] == 00) {
$findOrder = Payment::find($order->id);
$findOrder->is_status = Status::isDepositPaid;
$findOrder->urlRedirect = NULL;
$findUser = User::where('id', $order->user_id)->first();
$findUser->balance = ($findUser->balance + $order->amount);
// save
$findOrder->save();
$findUser->save();
}
}
}
$this->info('Status updated successfully!');
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
$schedule->command('orders:update')->everyFiveMinutes();
$schedule->command('deposit:update')->everyFiveMinutes();
$schedule->command('realtime-deposit:update')->everyFiveMinutes();
}
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -0,0 +1,167 @@
<?php
namespace App\Enums;
use MadWeb\Enum\Enum;
final class GlobalEnum extends Enum
{
// enum management menu
const isAdmin = 1;
const isEditor = 2;
const isModerator = 3;
const isMembers = 4;
const isKepalaSekolah = 2;
const isKonselor = 3;
const isSiswa = 4;
const isWaliMurid = 5;
// enum sites status
const isWebsiteActive = 1;
const isWebsiteInReview = 2;
const isWebsiteNotActive = 3;
const isWebsiteRejected = 4;
const isWebsiteDeactivated = 5;
// enum domain status
const isDomainActive = 1;
const isDomainInReview = 2;
const isDomainNotActive = 3;
const isDomainRejected = 4;
const isDomainDeactivated = 5;
// enum log type
const LogOfLogin = 1;
const LogOfGeneral = 2;
// enum buzzer services status
const isServiceActive = 1;
const isServiceNotActive = 2;
// enum withdrawal status
const isWithdrawPending = 1;
const isWithdrawOnProgress = 2;
const isWithdrawPaid = 3;
const isWithdrawCancel = 4;
// enum order status
const isOrderRequested = 1;
const isOrderOnWorking = 2;
const isOrderSubmitted = 3;
const isOrderRevision = 4;
const isOrderCompleted = 5;
const isOrderReqCancel = 6;
const isOrderCancelled = 7;
const isOrderRejected = 8;
// enum order history status
const isHistoryDone = 1;
const isHistoryRevision = 2;
const isHistoryJobDone = 3;
const isHistoryReqCancel = 4;
const isHistoryCanceled = 5;
// enum product buzzer & services status
const isProductActive = 1;
const isProductNotActive = 2;
// enum product buzzer order status
const isProductOrderPending = 1;
const isProductOrderPaymentAlready = 2;
const isProductOrderProcess = 3;
const isProductOrderDone = 4;
const isProductOrderCancel = 5;
const isProductOrderTypeMixed = 1;
const isProductOrderTypeMen = 2;
const isProductOrderTypeWomen = 3;
// enum product buzzer order detail comment status
const isProductCommentPending = 1;
const isProductCommentInReview = 2;
const isProductCommentDeclined = 3;
const isProductCommentApproved = 4;
// enum order type
const isOrderSites = 1;
const isOrderDomain = 2;
// enum user status
const isActive = 1;
const isInactive = 2;
const isDeactive = 3;
const isNotVerified = 4;
// enum seller status
const isSellerActive = 1;
const isSellerInActive = 2;
// enum order status
const isOrderPending = 1;
const isOrderProcessing = 2;
const isOrderInReview = 3;
const isOrderDeclined = 4;
const isOrderSuccessed = 5;
// enum deposit status
const isDepositPending = 1;
const isDepositInquiry = 2;
const isDepositFailed = 3;
const isDepositPaid = 4;
const isDepositCancel = 5;
// enum methodWithDeposit
const isMethodPayLater = 0;
const isMethodVirtual = 1;
// enum promotion status
const isPromotionAvailable = 1;
const isPromotionUsed = 2;
// enum content status
const isPostPublished = 1;
const isPostDraft = 2;
// enum ticket status
const isTicketPending = 1;
const isTicketClosed = 2;
const isTicketReplied = 3;
/* enum website-config
[1] SMTP Config
[2] Maintenance Mode
*/
const isMailerEnabled = 1;
const isMailerDisabled = 2;
const isMaintenanceMode = 3;
/* enum for seller modules
[1] Sites Listing
[2] Rekening
*/
const isSiteActive = 1;
const isSiteInReview = 2;
const isSiteNotActive = 3;
const isSiteRejected = 4;
const isSiteDeactivated = 5;
const isSiteOwner = 1;
const isSiteAuthor = 2;
const isSiteTypeDoFollow = 1;
const isSiteTypeNoFollow = 2;
// rekening status
const isRekeningActive = 1;
const isRekeningInactive = 2;
// ticket status
const isTicketSellerPending = 1;
const isTicketUserReplied = 2;
const isTicketAdminReplied = 3;
const isTicketSellerClosed = 4;
const isTicketPriorityNormal = 1;
const isTicketPriorityMedium = 2;
const isTicketPriorityHigh = 3;
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Enums;
use MadWeb\Enum\Enum;
/**
* @method static ProjectStatusEnum FOO()
* @method static ProjectStatusEnum BAR()
* @method static ProjectStatusEnum BAZ()
*/
final class ProjectStatusEnum extends Enum
{
const default = 0;
const PUBLISH = 1;
const DRAFT = 0;
}

View File

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

View File

@ -0,0 +1,718 @@
<?php
if (!function_exists('isAttachment')) {
/**
* Determines if the given image is an attachment.
*
* @param string $image The path of the image file.
* @return void
*/
function isAttachment($image){
$extension = pathinfo($image, PATHINFO_EXTENSION);
$imgExtArr = ['jpg', 'jpeg', 'png'];
if(in_array($extension, $imgExtArr)){
echo 'images';
} elseif(in_array($extension, ['xls','xlsx'])) {
echo 'excel';
} else {
echo 'word';
}
}
}
if(!function_exists('app_info'))
{
/**
* Retrieves the website configuration for the specified name.
*
* @param string $name The name of the website.
* @throws \Some_Exception_Class Description of the exception that can be thrown.
* @return mixed The website configuration.
*/
function app_info($name)
{
$websiteConfiguration = \App\Models\Website::where('name', $name)->first()->value;
return $websiteConfiguration;
}
}
if(!function_exists('insertBobot'))
{
function insertBobot($a, $b, $c)
{
$table = 'tbl_analisa_kriteria';
$exec = \DB::table($table)->insert([
'kriteria_pertama' => $a,
'nilai_analisa_kriteria' => $b,
'hasil_analisa_kriteria' => 0,
'kriteria_kedua' => $c,
]);
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('terbilang'))
{
function terbilang($x)
{
$angka = ["", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas"];
if ($x < 12)
return " " . $angka[$x];
elseif ($x < 20)
return terbilang($x - 10) . " belas";
elseif ($x < 100)
return terbilang($x / 10) . " puluh" . terbilang($x % 10);
elseif ($x < 200)
return "seratus" . terbilang($x - 100);
elseif ($x < 1000)
return terbilang($x / 100) . " ratus" . terbilang($x % 100);
elseif ($x < 2000)
return "seribu" . terbilang($x - 1000);
elseif ($x < 1000000)
return terbilang($x / 1000) . " ribu" . terbilang($x % 1000);
elseif ($x < 1000000000)
return terbilang($x / 1000000) . " juta" . terbilang($x % 1000000);
elseif ($x < 1000000000000)
return terbilang($x / 1000000000) . " milyar" . terbilang($x % 1000000000);
elseif ($x < 1000000000000000)
return terbilang($x / 1000000000000) . " triliun" . terbilang($x % 1000000000000);
}
}
if(!function_exists('insertBobotKriteria'))
{
function insertBobotKriteria($a, $b)
{
$exec = \DB::raw("UPDATE tbl_data_kriteria SET jumlah_kriteria = '$a' WHERE id_kriteria = '$b'");
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('updateBobotKriteria'))
{
function updateBobotKriteria($a, $b)
{
$exec = \DB::raw("UPDATE tbl_data_kriteria SET bobot_kriteria = '$a' WHERE id_kriteria = '$b'");
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('updateBobot'))
{
function updateBobot($a, $b, $c)
{
$exec = \DB::raw("UPDATE tbl_analisa_kriteria SET nilai_analisa_kriteria = '$b' WHERE kriteria_pertama = '$a' and kriteria_kedua = '$c'");
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('insert'))
{
/**
* Inserts data into the database.
*
* @param string $table The name of the table to insert into.
* @param array $data The data to insert.
* @throws \Some_Exception_Class Description of the exception that can be thrown.
* @return void
*/
function insert($a, $b, $c, $d)
{
$table = 'tbl_analisa_alternatif';
$exec = \DB::table($table)->insert([
'alternatif_pertama' => $a,
'nilai_analisa_alternatif' => $b,
'alternatif_kedua' => $c,
'id_kriteria' => $d,
]);
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('insert2'))
{
function insert2($a,$b,$c,$d){
$query = "update tbl_analisa_alternatif set hasil_analisa_alternatif = '$a' where alternatif_pertama = '$b' and alternatif_kedua = '$c' and id_kriteria='$d'";
$exec = \DB::raw($query);
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('insert4'))
{
function insert4($a,$b,$c){
$query = "update tbl_analisa_alternatif set skor_alt_kri='$a' where id_alternatif='$b' and id_kriteria='$c'";
$exec = \DB::raw($query);
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('readAll1'))
{
function readAll1($a, $b, $c){
$query = "SELECT * FROM tbl_analisa_alternatif where alternatif_pertama = '$a' and alternatif_kedua = '$b' and id_kriteria='$c' LIMIT 0,1";
$exec = \DB::table('tbl_analisa_alternatif')->where('alternatif_pertama', $a)->where('alternatif_kedua', $b)->where('id_kriteria', $c)->first();
if($exec) {
return $exec->nilai_analisa_alternatif;
} else {
return false;
}
}
}
if(!function_exists('readAvg'))
{
function readAvg($a){
$exec = \DB::table('tbl_analisa_alternatif')->where('alternatif_pertama', $a)->avg('nilai_analisa_alternatif');
if($exec) {
return $exec;
} else {
return false;
}
}
}
if(!function_exists('update'))
{
/**
* Updates data in the database.
*
* @param string $table The name of the table to update.
* @param array $data The data to update.
* @param string $where The condition to update.
* @throws \Some_Exception_Class Description of the exception that can be thrown.
* @return void
*/
function update($a, $b, $c, $d)
{
$exec = \DB::raw("UPDATE tbl_analisa_alternatif SET nilai_analisa_alternatif = '$b' WHERE alternatif_pertama = '$a' and alternatif_kedua = '$c' and id_kriteria = '$d'");
if($exec) {
return true;
} else {
return false;
}
}
}
if(!function_exists('app_smtp_info'))
{
/**
* Retrieves the website configuration for the specified name.
*
* @param string $name The name of the website.
* @throws \Some_Exception_Class Description of the exception that can be thrown.
* @return mixed The website configuration.
*/
function app_smtp_info()
{
$mailConfiguration = \App\Models\Mail::find(1)->first();
return $mailConfiguration;
}
}
if(!function_exists('hasExpired'))
{
/**
* Determines if the given date has expired.
*
* @param string $date The date to check.
* @return bool True if the date has expired, false otherwise.
*/
function hasExpired($accountCreatedAt)
{
// Konversi tanggal pembuatan akun menjadi objek DateTime
$accountCreatedTime = new DateTime($accountCreatedAt);
$currentTime = new DateTime();
// Hitung selisih waktu antara tanggal pembuatan akun dan waktu saat ini
$interval = $accountCreatedTime->diff($currentTime);
// Periksa jika selisih waktu lebih dari atau sama dengan 60 menit (3600 detik)
return $interval->format('%i') >= 60;
}
}
if(!function_exists('checkExpired'))
{
function checkExpired($createdAt, $isExpired)
{
$givenDate = new DateTime($createdAt);
$currentDate = new DateTime();
// Add 3 days to the current date
$currentDate->modify('+3 days');
// Compare the given date timestamp with the current date + 3 days timestamp
$isExpired = $givenDate > $currentDate;
return $isExpired;
}
}
/**
* Generate an application URL.
*
* @param string $url The URL to append to the application URL.
* @return string The generated application URL.
*/
if (!function_exists('app_url')) {
function app_url($url)
{
return url('app/' . $url);
}
}
if (!function_exists('site_url')) {
function site_url($type, $url)
{
switch($type)
{
case 'user':
return url('user/' . $url);
break;
}
}
}
if(!function_exists('removeUrlPrefix')) {
function removeUrlPrefix($url)
{
$url = preg_replace('#^https?://#', '', $url);
// Remove www. prefix
$url = preg_replace('#^www\.#', '', $url);
return $url;
}
}
if(!function_exists('invoiceGenerator')) {
function invoiceGenerator()
{
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$randomString = '';
for ($i = 0; $i < 8; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
// Membuat invoice dengan format INV-{timestamp}-{karakter-acak}
$invoice = 'INV-' . time() . '-' . $randomString;
return $invoice;
}
}
if(!function_exists('virtual_gateway')) {
function virtual_gateway($data)
{
$merchantCode = app_info('duitku_merchant');
$apiKey = app_info('duitku_client');
$paymentAmount = $data['amount'];
$merchantOrderId = $data['invoice'];
$productDetails = 'Pembayaran Deposit Saldo mengggunakan Duitku';
$email = user()->email;
$phoneNumber = '';
$additionalParam = '';
$merchantUserInfo = '';
$customerVaName = user()->name;
$callbackUrl = site_url('user', 'payment/deposit/callback');
$returnUrl = site_url('user', 'payment/deposit/return');
$expiryPeriod = 1440;
$signature = md5($merchantCode . $merchantOrderId . $paymentAmount . $apiKey);
// Customer Detail
$firstName = 'DEPA';
$lastName = 'Auto Deposit';
$alamat = "Jl. Jakarta";
$city = "Jakarta";
$postalCode = "11530";
$countryCode = "ID";
$address = array(
'firstName' => $firstName,
'lastName' => $lastName,
'address' => $alamat,
'city' => $city,
'postalCode' => $postalCode,
'phone' => $phoneNumber,
'countryCode' => $countryCode
);
$customerDetail = array(
'firstName' => $firstName,
'lastName' => $lastName,
'email' => $email,
'phoneNumber' => $phoneNumber,
'billingAddress' => $address,
'shippingAddress' => $address
);
$item1 = array(
'name' => 'Deposit Saldo POSTAMU',
'price' => $data['amount'],
'quantity' => 1
);
$itemDetails = array($item1);
$params = array(
'merchantCode' => $merchantCode,
'paymentAmount' => $paymentAmount,
'paymentMethod' => $data['method'],
'merchantOrderId' => $merchantOrderId,
'productDetails' => $productDetails,
'additionalParam' => $additionalParam,
'merchantUserInfo' => $merchantUserInfo,
'customerVaName' => $customerVaName,
'email' => $email,
'phoneNumber' => $phoneNumber,
// 'accountLink' => $accountLink,
'itemDetails' => $itemDetails,
'customerDetail' => $customerDetail,
'callbackUrl' => $callbackUrl,
'returnUrl' => $returnUrl,
'signature' => $signature,
'expiryPeriod' => $expiryPeriod
);
$params_string = json_encode($params);
if(app_info('duitku_sandbox') == 1) {
$url = 'https://sandbox.duitku.com/webapi/api/merchant/v2/inquiry'; // Sandbox
} else {
$url = 'https://passport.duitku.com/webapi/api/merchant/v2/inquiry'; // Production
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $params_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($params_string))
);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//execute post
$request = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($httpCode == 200) {
$result = json_decode($request, true);
return [
'url' => $result['paymentUrl'],
'status' => 'success'
];
} else {
$result = json_decode($request, true);
return [
'msg' => 'Terjadi kesalahan tidak terduga.',
'status' => 'error',
'error' => $result
];
}
}
}
if(!function_exists('isUrlSecure')) {
function isUrlSecure($url)
{
return strpos($url, 'https://') !== false;
}
}
if(!function_exists('filterExists')) {
function filterExists()
{
if(!empty(\Illuminate\Support\Facades\Request::input('filterType'))
|| !empty(\Illuminate\Support\Facades\Request::input('categoryFilter'))
|| !empty(\Illuminate\Support\Facades\Request::input('minimumPrice'))
|| !empty(\Illuminate\Support\Facades\Request::input('maximumPrice'))
|| !empty(\Illuminate\Support\Facades\Request::input('searchFilter'))) {
return true;
} else {
return false;
}
}
}
if(!function_exists('date_formatting')) {
function date_formatting($date, $format)
{
switch($format)
{
case 'd-m-Y':
return date('d-m-Y', strtotime($date));
break;
case 'indonesia':
$month = array (
1 => 'Januari',
'Februari',
'Maret',
'April',
'Mei',
'Juni',
'Juli',
'Agustus',
'September',
'Oktober',
'November',
'Desember'
);
$reformat = explode('-', $date);
return $reformat[2] . ' ' . $month[ (int)$reformat[1] ] . ' ' . $reformat[0];
break;
case 'timeago':
$time_difference = time() - strtotime($date);
if( $time_difference < 1 ) { return '1 detik yang lalu'; }
$condition = array( 12 * 30 * 24 * 60 * 60 => 'year',
30 * 24 * 60 * 60 => 'bulan',
24 * 60 * 60 => 'hari',
60 * 60 => 'jam',
60 => 'menit',
1 => 'detik'
);
foreach( $condition as $secs => $str )
{
$d = $time_difference / $secs;
if( $d >= 1 )
{
$t = round( $d );
return $t . ' ' . $str . ( $t > 1 ? '' : '' ) . ' yang lalu';
}
}
break;
}
}
}
if(!function_exists('findUser')) {
function findUser($id)
{
return \App\Models\User::find($id)->first();
}
}
if(!function_exists('switch_page')) {
function switch_page()
{
}
}
if(!function_exists('isSeller')) {
function isSeller()
{
$checkUserModel = \App\Models\Seller::where('user_id', \Illuminate\Support\Facades\Auth::user()->id)->count();
if($checkUserModel > 0){
return true;
} else {
return false;
}
}
}
if(!function_exists('active_page')) {
function active_page($activePage)
{
$currentRoute = \Illuminate\Support\Facades\Route::currentRouteName();
if ($currentRoute) {
$routeUri = htmlspecialchars($currentRoute);
if($routeUri === $activePage) { return 'active'; }
}
return '';
}
}
if(!function_exists('routesAll')) {
function routesAll()
{
$routesInAppPrefix = [];
foreach (\Illuminate\Support\Facades\Route::getRoutes() as $route) {
$uri = $route->uri();
// Check if the route URI starts with the desired prefix
if (strpos($uri, 'app/') === 0) {
$routesInAppPrefix[] = $route->action['as'];
}
}
$convertIntoJson = json_encode($routesInAppPrefix, true);
return json_decode($convertIntoJson, true);
}
}
/**
* Retrieves the currently authenticated user.
*
* @return User The currently authenticated user.
*/
if (!function_exists('user')) {
function user()
{
return \Illuminate\Support\Facades\Auth::user();
}
}
if(!function_exists('segment')) {
/**
* Retrieves a segment from the current request.
*
* @param int $key The key of the segment to retrieve.
* @return mixed The value of the segment.
*/
function segment($key)
{
return request()->segment($key);
}
}
if(!function_exists('enum')) {
/**
* Retrieves the value of a constant from the GlobalEnum class.
*
* @param string $args The name of the constant to retrieve.
* @return mixed The value of the constant.
*/
function enum($args)
{
return constant("\App\Enums\GlobalEnum::$args");
}
}
/**
* Generate a Gravatar URL for a given email.
*
* @param string $email The email address to generate the Gravatar URL for.
* @throws None
* @return string The Gravatar URL.
*/
if (!function_exists('gravatar_team')) {
function gravatar_team($email)
{
$username = md5($email);
return "https://www.gravatar.com/avatar/$username?s=70&d=retro&r=y";
}
}
/**
* Convert a number into Indonesian Rupiah format.
*
* @param int $nominal The number to be converted.
* @return string The converted number in Indonesian Rupiah format.
*/
if (!function_exists('rupiah')) {
function rupiah($nominal)
{
return 'Rp. ' . number_format($nominal,0,',','.');
}
}
/**
* A function that changes the given nominal value into a different format.
*
* @param string $nominal The nominal value to be changed.
* @return string The changed nominal value.
*/
if (!function_exists('rupiah_changer')) {
function rupiah_changer($nominal)
{
if(strlen($nominal) == 4) {
return substr($nominal, 0, 1) . 'RB';
} elseif(strlen($nominal) == 5) {
return substr($nominal, 0, 2) . 'RB';
} elseif(strlen($nominal) == 6) {
return substr($nominal, 0, 3) . 'RB';
} elseif(strlen($nominal) == 7) {
return substr($nominal, 0, 1) . 'JT';
} elseif(strlen($nominal) == 8) {
return substr($nominal, 0, 2) . 'JT';
} elseif(strlen($nominal) == 9) {
return substr($nominal, 0, 3) . 'JT';
} elseif(strlen($nominal) == 10) {
return substr($nominal, 0, 1) . 'M';
} elseif(strlen($nominal) == 11) {
return substr($nominal, 0, 2) . 'M';
} elseif(strlen($nominal) == 12) {
return substr($nominal, 0, 3) . 'M';
} elseif(strlen($nominal) == 13) {
return substr($nominal, 0, 1) . 'T';
} elseif(strlen($nominal) == 14) {
return substr($nominal, 0, 2) . 'T';
} elseif(strlen($nominal) == 15) {
return substr($nominal, 0, 3) . 'T';
} else {
return 0;
}
}
}
/**
* Formats a phone number.
*
* @param string $value The phone number to be formatted.
* @return string The formatted phone number.
*/
if (!function_exists('phone_formatter')) {
function phone_formatter($value) {
// kadang ada penulisan no hp 0811 239 345
$nohp = str_replace(" ","",$value);
// kadang ada penulisan no hp (0274) 778787
$nohp = str_replace("(","",$value);
// kadang ada penulisan no hp (0274) 778787
$nohp = str_replace(")","",$value);
// kadang ada penulisan no hp 0811.239.345
$nohp = str_replace(".","",$value);
// cek apakah no hp mengandung karakter + dan 0-9
if(!preg_match('/[^+0-9]/',trim($nohp))){
// cek apakah no hp karakter 1-3 adalah +62
if(substr(trim($nohp), 0, 3)=='+62'){
$hp = trim($nohp);
}
// cek apakah no hp karakter 1 adalah 0
elseif(substr(trim($nohp), 0, 1)=='0'){
$hp = '+62'.substr(trim($nohp), 1);
}
}
return $hp;
}
}

View File

@ -0,0 +1,97 @@
<?php
/**
* Retrieves the value of the specified website name from the database.
*
* @param string $name The name of the website.
* @throws Exception If the website does not exist.
* @return mixed The value of the website.
*/
if (!function_exists('frontend_db')) {
function frontend_db($name)
{
return \App\Models\Website::where('name', $name)->first()->value;
}
}
if(!function_exists('app_url')) {
function app_url($name)
{
return url('app' . $name);
}
}
if(!function_exists('assets_url')) {
function assets_url($name)
{
$image = str_replace('public/', '', $name);
return asset('storage/' . $image);
}
}
if(!function_exists('frontend')) {
function frontend($var)
{
return asset('frontend/' . $var);
}
}
if(!function_exists('pages')) {
function pages($var)
{
return asset('landing/' . $var);
}
}
/**
* Display a SweetAlert popup based on the given type and message.
*
* @param string $type The type of the alert (e.g., 'danger', 'success').
* @param string $msg The message to be displayed in the alert.
* @return string The generated JavaScript code for the SweetAlert popup.
*/
if (!function_exists('swal_alert')) {
function swal_alert($type, $msg)
{
switch($type)
{
case 'error':
return "
<script>
Swal.fire(
'Woops..',
'$msg',
'error'
)
</script>
";
break;
case 'success':
return "
<script>
Swal.fire(
'Success',
'$msg',
'success'
)
</script>
";
break;
}
}
}
/**
* Retrieves the "swal" session value.
*
* @return mixed The value of the "swal" session.
*/
if (!function_exists('swal_response')) {
function swal_response()
{
if(session()->has('swal')) {
return session('swal');
}
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Helpers;
use Illuminate\Support\Facades\Mail;
class MailerHelper
{
/**
* Sends an email to the specified email address.
*
* @param string $email The email address to send the email to.
* @param bool $plain Whether to send the email as plain text or not.
* @param string|null $view The view to use for the email content.
* @param array $data Additional data to pass to the email view.
* @throws \Exception If an error occurs while sending the email.
* @return bool Whether the email was sent successfully or not.
*/
public static function to($recipientEmail, $plain = false, $view = null, $data = [])
{
$message = $data['message'];
$subject = $data['subject'];
switch($plain)
{
case true:
try {
Mail::raw($message, function ($message) use ($recipientEmail, $subject) {
$message->to($recipientEmail)->subject($subject);
});
return true;
} catch (\Exception $e) {
return false;
}
break;
case false;
try {
Mail::send($view, ['data' => $data], function ($message) use ($recipientEmail, $subject) {
$message->to($recipientEmail)
->subject($subject);
});
return true;
} catch (\Exception $e) {
return $e->getMessage();
}
break;
}
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use App\Enums\GlobalEnum;
use DataTables;
class AdminController extends Controller
{
public function index()
{
}
public function activity()
{
}
}

View File

@ -0,0 +1,169 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use GuzzleHttp\Client;
use Carbon\Carbon;
use App\Models\Akun;
class AkunController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = Akun::select('*');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::of($data)
->addIndexColumn()
->addColumn('title-post', function($row){
$text = '
<p class="mb-0">' . $row->gejala . '</p>
';
return $text;
})
->rawColumns(['title-post'])
->make(true);
}
$data = [
'subtitle' => 'Akun',
'button' => true,
'module' => [
'url' => route('akun.create'),
'name' => 'Tambah Baru'
]
];
return view('admin.app.content.akun.index', compact('data'));
}
public function create()
{
$data = [
'subtitle' => 'Tambah baru',
];
return view('admin.app.content.akun.add', compact('data'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'nama_akun' => 'required',
'kode_akun' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
$input = $request->all();
$post = new Akun([
'nama_akun' => $input['nama_akun'], // Membersihkan input judul menggunakan Purifier
'kode_akun' => $input['kode_akun'], // Membersihkan input deskripsi menggunakan Purifier
]);
$check = Akun::where('kode_akun', $input['kode_akun'])->where('nama_akun', $input['nama_akun'])->count();
if ($check == 0) {
if ($post->save()) {
return redirect()->route('akun')->with('success', 'You have successfully added data');
} else {
return redirect()->route('akun')->with('error', 'An error occurred in the query');
}
} else {
return redirect()->route('akun')->with('error', 'Title already exists');
}
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$data = [
'subtitle' => 'Edit: ' . Akun::where('id', $id)->first()->nama_akun,
];
$akun = Akun::FindOrFail($id);
return view('admin.app.content.akun.edit', compact('data', 'id', 'akun'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
// Validasi input sebelum memperbarui data
$validator = Validator::make($request->all(), [
'nama_akun' => 'required',
'kode_akun' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
// Cari data berdasarkan ID
$akun = Akun::find($id);
// Jika data ditemukan
if ($akun) {
// Update data dengan data baru dari form yang telah dibersihkan
$akun->nama_akun = $request->input('nama_akun');
$akun->kode_akun = $request->input('kode_akun');
// Simpan perubahan pada database
$akun->save();
return redirect()->route('akun')->with('success', 'You are successfully added new records');
} else {
return redirect()->route('akun')->with('error', 'Unexpected error');
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
// Cari data berdasarkan ID
$post = Akun::find($id);
// Jika data ditemukan
if ($post) {
// Hapus data dari database
$post->delete();
return redirect()->route('akun')->with('success', 'You are successfully deleted records');
} else {
return redirect()->route('akun')->with('error', 'Data not found');
}
}
}

View File

@ -0,0 +1,618 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use App\Models\Akun;
use App\Models\Jurnal;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
use Crabbly\Fpdf\Fpdf as FPDF;
class AkuntanController extends Controller
{
// beranda
public function index()
{
$daftar_jurnal = Jurnal::selectRaw("CONCAT(MONTH(waktu_transaksi), '-', YEAR(waktu_transaksi)) as waktu")->distinct()->get();
$total_jurnal = $daftar_jurnal->count();
$data = [
'subtitle' => 'Jurnal Umum',
'button' => true,
'module' => [
'url' => route('jurnal-umum.create'),
'name' => 'Tambah Baru'
]
];
return view('admin.app.content.jurnal_umum.index', compact('daftar_jurnal', 'total_jurnal', 'data'));
}
public function detailJurnalUmum(Request $request, $waktu)
{
if(empty($waktu)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$periode = date('F Y', strtotime($waktu));
$daftar_jurnal = Jurnal::with("akun")->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->get();
$total_debet = Jurnal::where('tipe', 'd')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$total_kredit = Jurnal::where('tipe', 'k')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$total_jurnal = $daftar_jurnal->count();
// print_r($daftar_jurnal[0]->akun->nama_akun); die();
$data = [
'subtitle' => 'Detail Periode ' . $periode
];
return view('admin.app.content.jurnal_umum.detail', compact('data', 'daftar_jurnal', 'total_jurnal', 'periode', 'total_debet', 'total_kredit'));
}
public function cariJurnalUmum(Request $request)
{
$bulan = $request->input('bulan');
$tahun = $request->input('tahun');
$waktu = $tahun.'-'.$bulan.'-01';
$periode = date('F Y', strtotime($waktu));
if(empty($bulan) || empty($tahun)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$daftar_jurnal = Jurnal::whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->get();
$total_debet = Jurnal::where('tipe', 'd')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$total_kredit = Jurnal::where('tipe', 'k')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$total_jurnal = $daftar_jurnal->count();
if(!($total_jurnal)) return redirect()->back()->with('error', "Jurnal Umum dengan Periode $bulan-$tahun tidak ditemukan");
$data = [
'subtitle' => 'Detail Periode ' . $periode,
];
return view('admin.app.content.jurnal_umum.detail', compact('data', 'daftar_jurnal', 'total_jurnal', 'periode', 'total_debet', 'total_kredit'));
}
public function formJurnalUmum()
{
$daftar_akun = Akun::all();
$data = [
'subtitle' => 'Tambah Baru',
];
return view('admin.app.content.jurnal_umum.add', compact('daftar_akun', 'data'));
}
public function storeJurnalUmum(Request $request)
{
$validator = Validator::make($request->all(), [
'keterangan' => 'required|string|max:255',
'waktu_transaksi' => 'required|date',
'nominal' => 'required|integer',
'tipe' => 'required|in:d,k',
'id_akun' => 'required|max:10',
]);
if ($validator->fails()) {
return redirect()->back()->with('error', $validator->errors()->first());
}
$jurnal = Jurnal::create($request->all());
if($jurnal) {
return redirect()->route('jurnal-umum')->with('success', 'Transaksi Berhasil Ditambahkan');
} else {
return redirect()->back()->with('error', 'Transaksi Gagal Ditambahkan');
}
}
public function editJurnalUmum($id)
{
$daftar_akun = Akun::all();
$jurnal = Jurnal::findOrFail($id);
$data = [
'subtitle' => 'Edit Jurnal Umum',
];
return view('admin.app.content.jurnal_umum.edit', compact('jurnal', 'daftar_akun', 'data', 'id'));
}
public function updateJurnalUmum(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'keterangan' => 'required|string|max:255',
'waktu_transaksi' => 'required|date',
'nominal' => 'required|integer',
'tipe' => 'required|in:d,k',
'id_akun' => 'required|max:10',
]);
if ($validator->fails()) {
return redirect()->back()->with('error', $validator->errors()->first());
}
$jurnal = Jurnal::findOrFail($id);
if(!($jurnal)) return redirect()->back()->with('error', 'Transaksi Tidak Ditemukan');
$jurnal->keterangan = $request->input('keterangan');
$jurnal->waktu_transaksi = $request->input('waktu_transaksi');
$jurnal->nominal = $request->input('nominal');
$jurnal->tipe = $request->input('tipe');
$jurnal->id_akun = $request->input('id_akun');
if($jurnal->save()) {
return redirect()->route('jurnal-umum')->with('success', 'Transaksi Berhasil Diubah');
} else {
return redirect()->back()->with('error', 'Transaksi Gagal Diubah');
}
}
public function destroyJurnalUmum($id)
{
$jurnal = Jurnal::findOrFail($id);
if(!($jurnal)) return redirect()->back()->with('error', 'Transaksi Tidak Ditemukan');
if($jurnal->delete()) {
return redirect()->route('jurnal-umum')->with('success', 'Transaksi Berhasil Dihapus');
} else {
return redirect()->back()->with('error', 'Transaksi Gagal Dihapus');
}
}
// buku besar
public function showBukuBesar()
{
$daftar_akun = Akun::all();
$data = [
'subtitle' => 'Buku Besar',
];
return view('admin.app.content.buku-besar', compact('daftar_akun', 'data'));
}
public function akunBukuBesar($id)
{
$daftar_buku = Jurnal::selectRaw("CONCAT(MONTH(waktu_transaksi), '-', YEAR(waktu_transaksi)) as waktu")->where('id_akun', $id)->distinct()->get();
$total_buku = $daftar_buku->count();
$akun = Akun::findOrFail($id);
$data = [
'subtitle' => 'Akun Buku Besar',
];
return view('admin.app.content.akun-buku-besar', compact('daftar_buku', 'total_buku', 'akun', 'data'));
}
public function detailBukuBesar($id, $waktu)
{
if(empty($waktu) || empty($id)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$periode = date('F Y', strtotime($waktu));
$daftar_buku = Jurnal::whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->get();
$total_debet = Jurnal::where('tipe', 'd')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->sum('nominal');
$total_kredit = Jurnal::where('tipe', 'k')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->sum('nominal');
$total_buku = $daftar_buku->count();
$akun = Akun::findOrFail($id);
$data = [
'subtitle' => 'Detail Periode ' . $periode,
];
return view('admin.app.content.detail-buku-besar', compact('data', 'daftar_buku', 'total_buku', 'periode', 'total_debet', 'total_kredit', 'akun'));
}
public function cariBukuBesar($id, Request $request)
{
$bulan = $request->input('bulan');
$tahun = $request->input('tahun');
$waktu = $tahun.'-'.$bulan.'-01';
$periode = date('F Y', strtotime($waktu));
if(empty($id) || empty($bulan) || empty($tahun)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$daftar_buku = Jurnal::whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->get();
$total_debet = Jurnal::where('tipe', 'd')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->sum('nominal');
$total_kredit = Jurnal::where('tipe', 'k')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $id)->sum('nominal');
$total_buku = $daftar_buku->count();
$akun = Akun::findOrFail($id);
if(!($total_buku)) return redirect()->back()->with('error', "Buku Besar dengan Periode $periode tidak ditemukan");
$data = [
'subtitle' => 'Detail Periode ' . $periode,
];
return view('admin.app.content.detail-buku-besar', compact('data', 'daftar_buku', 'total_buku', 'periode', 'total_debet', 'total_kredit', 'akun'));
}
// neraca saldo
public function showNeracaSaldo()
{
$daftar_neraca = Jurnal::selectRaw("CONCAT(MONTH(waktu_transaksi), '-', YEAR(waktu_transaksi)) as waktu")->distinct()->get();
$total_neraca = $daftar_neraca->count();
$data = [
'subtitle' => 'Neraca Saldo',
];
return view('admin.app.content.neraca-saldo', compact('data', 'daftar_neraca', 'total_neraca'));
}
public function detailNeracaSaldo(Request $request, $waktu)
{
if (empty($waktu)) {
return redirect()->back()->with('error', 'Data Tidak Ditemukan');
}
$total_saldo_debet = 0;
$total_saldo_kredit = 0;
$periode = date('F Y', strtotime($waktu));
// Ambil data akun
$daftar_akun = Akun::all();
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$detail = [];
foreach ($daftar_akun as $akun) {
$debet = Jurnal::where('tipe', 'd')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->where('id_akun', $akun->id)
->sum('nominal');
$kredit = Jurnal::where('tipe', 'k')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->where('id_akun', $akun->id)
->sum('nominal');
$detail[] = [
'nama_akun' => $akun->nama_akun,
'debet' => $debet,
'kredit' => $kredit,
];
$total_saldo_debet += $debet;
$total_saldo_kredit += $kredit;
}
$data = [
'subtitle' => 'Detail Periode ' . $periode,
];
return view('admin.app.content.detail-neraca-saldo', compact('data', 'detail', 'total_saldo_debet', 'total_saldo_kredit', 'periode', 'bulan', 'tahun'));
return view('nama_tampilan', [
'bulan' => $bulan,
'tahun' => $tahun,
// Melewatkan variabel lain jika diperlukan
]);
}
public function cetakNeracaSaldo($waktu)
{
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$periode = date('F Y', strtotime($waktu));
$periode = strtoupper($periode);
// Ambil data akun
$daftar_akun = Akun::all();
$total_saldo_debet = 0;
$total_saldo_kredit = 0;
$pdf = new FPDF;
$pdf->AddPage('L', 'A4');
// Header
$pdf->SetFont('Arial', 'B', 18);
$pdf->Cell(0, 10, 'Akuntansi', 0, 2, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Ln();
// Neraca Saldo
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(0, 10, "NERACA SALDO $periode", 0, 2, 'C');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(84, 10, "AKUN", 1, 0, 'C');
$pdf->Cell(84, 10, "DEBET", 1, 0, 'C');
$pdf->Cell(84, 10, "KREDIT", 1, 0, 'C');
$pdf->Ln();
foreach ($daftar_akun as $akun) {
$debet = Jurnal::where('tipe', 'd')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->where('id_akun', $akun->id)
->sum('nominal');
$kredit = Jurnal::where('tipe', 'k')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->where('id_akun', $akun->id)
->sum('nominal');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(84, 10, $akun->nama_akun, 1, 0, 'C');
$pdf->Cell(84, 10, "Rp. " . number_format($debet, 0, ',', '.') . ",-", 1, 0, 'C');
$pdf->Cell(84, 10, "Rp. " . number_format($kredit, 0, ',', '.') . ",-", 1, 0, 'C');
$pdf->Ln();
$pdf->Ln();
$total_saldo_debet += $debet;
$total_saldo_kredit += $kredit;
}
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(84, 10, "TOTAL", 1, 0, 'C');
$pdf->Cell(84, 10, "Rp. " . number_format($total_saldo_debet, 0, ',', '.') . ",-", 1, 0, 'C');
$pdf->Cell(84, 10, "Rp. " . number_format($total_saldo_kredit, 0, ',', '.') . ",-", 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(31, 10, "TERBILANG", 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(168, 10, strtoupper(terbilang($total_saldo_debet)) . " RUPIAH", 1, 0, 'C');
$pdf->Ln();
// Footer
$pdf->SetY(179);
$pdf->SetX(175);
$pdf->SetFont('Arial', 'I', 8);
$pdf->Cell(0, 10, "Dicetak Oleh Akuntan : " . user()->name . " Pada " . date("d-m-Y H:i:s")
. " WIB", 0, 0, 'C');
Session::flash('pesan', 'Laporan Neraca Berhasil Diunduh');
return $pdf->Output('D', "Laporan Neraca $periode.pdf");
}
public function showLabaRugi()
{
$daftar_laba = Jurnal::selectRaw("CONCAT(MONTH(waktu_transaksi), '-', YEAR(waktu_transaksi)) as waktu")->distinct()->get();
$total_laba = $daftar_laba->count();
$data = [
'subtitle' => 'Laba Rugi',
];
return view('admin.app.content.laba-rugi', compact('data', 'daftar_laba', 'total_laba'));
}
public function detailLabaRugi(Request $request, $waktu)
{
if(empty($waktu)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$total_akun = Akun::count();
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$periode = date('F Y', strtotime($waktu));
$totalPembeliandebit = Jurnal::where('id_akun', 1)
->where('tipe', 'k')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->sum('nominal');
//Hutang Usaha (Total Pembelian Kredit/Hutang)
$hutangUsaha = Jurnal::selectRaw('SUM(CASE WHEN tipe = "k" THEN nominal ELSE 0 END) AS total_kredit')
->selectRaw('SUM(CASE WHEN tipe = "d" THEN nominal ELSE 0 END) AS total_debit')
->where('id_akun', 14)
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->first();
$totalKredit = $hutangUsaha->total_kredit ?? 0;
$totalDebit = $hutangUsaha->total_debit ?? 0;
$hutangUsaha = $totalKredit - $totalDebit;
$hpp = $totalPembeliandebit + $hutangUsaha;
//Piutang Usaha (Total Pembelian Kredit/Hutang)
$piutangUsaha = Jurnal::selectRaw('SUM(CASE WHEN tipe = "k" THEN nominal ELSE 0 END) AS total_kredit')
->selectRaw('SUM(CASE WHEN tipe = "d" THEN nominal ELSE 0 END) AS total_debit')
->where('id_akun', 2)
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->first();
$totalKredit = $piutangUsaha->total_kredit ?? 0;
$totalDebit = $piutangUsaha->total_debit ?? 0;
$piutangUsaha = $totalDebit - $totalKredit;
$hpp = $totalPembeliandebit + $hutangUsaha;
$totalPendapatan = Jurnal::where('id_akun',9)
->where('tipe', 'k')
->whereMonth('waktu_transaksi', $bulan)
->whereYear('waktu_transaksi', $tahun)
->sum('nominal');
$data = [
'subtitle' => 'Detail Periode ' . $periode,
'totalPembeliandebit' => $totalPembeliandebit,
'hpp' => $hpp
];
return view('admin.app.content.detail-laba-rugi', compact('data', 'bulan', 'tahun', 'periode', 'totalPembeliandebit', 'totalPendapatan', 'hpp'));
}
public function cariLabaRugi(Request $request)
{
$bulan = $request->input('bulan');
$tahun = $request->input('tahun');
$waktu = $tahun.'-'.$bulan.'-01';
$periode = date('F Y', strtotime($waktu));
if(empty($bulan) || empty($tahun)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$data = [
'subtitle' => 'Detail Periode ' . $periode,
];
return view('admin.app.content.detail-laba-rugi', compact('data', 'bulan', 'tahun', 'periode'));
}
public function showLaporan()
{
$daftar_jurnal = Jurnal::selectRaw("CONCAT(MONTH(waktu_transaksi), '-', YEAR(waktu_transaksi)) as waktu")->distinct()->get();
$total_jurnal = $daftar_jurnal->count();
$data = [
'subtitle' => 'Laporan',
];
return view('admin.app.content.laporan', compact('data','daftar_jurnal', 'total_jurnal'));
}
public function cetakLaporan($waktu)
{
if(empty($waktu)) return redirect()->back()->with('error', 'Data Tidak Ditemukan');
$pdf = new FPDF;
$pdf->AddPage('L', 'A4');
$bulan = date('m', strtotime($waktu));
$tahun = date('Y', strtotime($waktu));
$periode = date('F Y', strtotime($waktu));
$periode = strtoupper($periode);
// Header
$pdf->SetFont('Arial', 'B', 18);
$pdf->Cell(0, 10, 'Akuntansi', 0, 2, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(0, 10, "LAPORAN KEUANGAN $periode", 0, 2, 'C');
// Jurnal Umum
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(0, 10, "JURNAL UMUM $periode", 0, 2, 'C');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(25, 10, "NO", 1, 0, 'C');
$pdf->Cell(63, 10, "WAKTU", 1, 0, 'C');
$pdf->Cell(63, 10, "AKUN", 1, 0, 'C');
$pdf->Cell(63, 10, "DEBET", 1, 0, 'C');
$pdf->Cell(63, 10, "KREDIT", 1, 0, 'C');
$pdf->Ln();
$daftar_jurnal = Jurnal::whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->get();
$total_debet = Jurnal::where('tipe', 'd')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$total_kredit = Jurnal::where('tipe', 'k')->whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->sum('nominal');
$pdf->SetFont('Arial', '', 12);
$i = 1;
foreach($daftar_jurnal as $data)
{
$pdf->Cell(25, 10, $i++, 1, 0, 'C');
$pdf->Cell(63, 10, $data->waktu_transaksi, 1, 0, 'C');
$pdf->Cell(63, 10, $data->akun->nama_akun, 1, 0, 'C');
if($data->tipe === 'd') $pdf->Cell(63, 10, 'Rp. '.number_format($data->nominal, 0, ',', '.').',-', 1, 0, 'C');
else $pdf->Cell(63, 10, '-', 1, 0, 'C');
if($data->tipe === 'k') $pdf->Cell(63, 10,'Rp. '.number_format($data->nominal, 0, ',', '.').',-', 1, 0, 'C');
else $pdf->Cell(63, 10, '-', 1, 0, 'C');
$pdf->Ln();
}
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(151, 10, 'TOTAL', 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(63, 10, 'Rp. '. number_format($total_debet, 0, ',', '.') . ',-', 1, 0, 'C');
$pdf->Cell(63, 10, 'Rp. ' .number_format($total_kredit, 0, ',', '.') . ',-', 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(35, 10, 'TERBILANG', 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(121, 10, strtoupper(terbilang($total_debet)).' RUPIAH', 1, 0, 'C');
$pdf->Cell(121, 10, strtoupper(terbilang($total_kredit)).' RUPIAH', 1, 0, 'C');
$pdf->Ln();
// Footer
$pdf->SetY(179);
$pdf->SetX(175);
$pdf->SetFont('Arial','I',8);
$pdf->Cell(0,10,"Dicetak Oleh Akuntan : " . user()->name . " Pada ".date("d-m-Y H:i:s")
." WIB",0,0,'C');
$pdf->AddPage('L', 'A4');
// Buku Besar
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(0, 10, "DAFTAR BUKU BESAR $periode", 0, 2, 'C');
$id = Akun::pluck('id');
foreach($id as $i)
{
$daftar_buku[$i] = Jurnal::whereMonth('waktu_transaksi', $bulan)->whereYear('waktu_transaksi', $tahun)->orderBy('waktu_transaksi', 'asc')->where('id_akun', $i)->get();
$data[$i] =
[
'akun' => Akun::findOrFail($i),
'daftar_buku' => $daftar_buku[$i],
'jumlah_debet' => $daftar_buku[$i]->where('tipe', 'd')->sum('nominal'),
'jumlah_kredit' => $daftar_buku[$i]->where('tipe', 'k')->sum('nominal'),
];
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(92, 10, "AKUN : " . $data[$i]['akun']->nama_akun, 0, 0, 'L');
$pdf->Cell(92, 10, "PERIODE : $periode", 0, 0, 'C');
$pdf->Cell(92, 10, "KODE : " . $data[$i]['akun']->kode_akun, 0, 0, 'R');
$pdf->Ln();
$pdf->Cell(138, 10, "TRANSAKSI", 1, 0, 'C');
$pdf->Cell(138, 10, "SALDO", 1, 0, 'C');
$pdf->Ln();
$pdf->Cell(10, 10, "NO", 1, 0, 'C');
$pdf->Cell(30, 10, "WAKTU", 1, 0, 'C');
$pdf->Cell(125, 10, "KETERANGAN", 1, 0, 'C');
$pdf->Cell(56, 10, "DEBET", 1, 0, 'C');
$pdf->Cell(55, 10, "KREDIT", 1, 0, 'C');
$pdf->Ln();
$j = 1;
foreach($data[$i]['daftar_buku'] as $item){
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(10, 10, $j, 1, 0, 'C');
$pdf->Cell(30, 10, $item['waktu_transaksi'], 1, 0, 'C');
$pdf->Cell(125, 10, $item['keterangan'], 1, 0, 'C');
$pdf->Cell(56, 10, "Rp. ".number_format( ($item['tipe'] === 'd') ? $item['nominal'] : "0" , 0, ',', '.').",-", 1, 0, 'C');
$pdf->Cell(55, 10, "Rp. " .number_format( ($item['tipe'] === 'k') ? $item['nominal'] : "0" , 0, ',', '.'). ",-", 1, 0, 'C');
$pdf->Ln();
$j++;
}
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(140, 10, "JUMLAH", 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(68, 10, "Rp. ". number_format($data[$i]['jumlah_debet'], 0, ',', '.') .",-", 1, 0, 'C');
$pdf->Cell(68, 10, "Rp. ". number_format($data[$i]['jumlah_kredit'], 0, ',', '.') .",-", 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(140, 10, "SALDO", 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(136, 10, "Rp. ". number_format( (substr($data[$i]['akun']->kode_akun, 0, 1) === '1' || substr($data[$i]['akun']->kode_akun, 0, 1) === '11') ? $data[$i]['jumlah_debet'] - $data[$i]['jumlah_kredit'] : (((substr($data[$i]['akun']->kode_akun, 0, 1) === '2' || substr($data[$i]['akun']->kode_akun, 0, 1) === '3') || substr($data[$i]['akun']->kode_akun, 0, 1) === '5') ? $data[$i]['jumlah_kredit'] - $data[$i]['jumlah_debet'] : "0")
, 0, ',', '.') .",-", 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(50, 10, "TERBILANG", 1, 0, 'C');
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(226, 10, strtoupper( terbilang((substr($data[$i]['akun']->kode_akun, 0, 1) === '1' || substr($data[$i]['akun']->kode_akun, 0, 1) === '11') ? $data[$i]['jumlah_debet'] - $data[$i]['jumlah_kredit'] : (((substr($data[$i]['akun']->kode_akun, 0, 1) === '2' || substr($data[$i]['akun']->kode_akun, 0, 1) === '3') || substr($data[$i]['akun']->kode_akun, 0, 1) === '5') ? $data[$i]['jumlah_kredit'] - $data[$i]['jumlah_debet'] : "0"))) . "RUPIAH", 1, 0, 'C');
$pdf->Ln();
// Footer
$pdf->SetY(179);
$pdf->SetX(175);
$pdf->SetFont('Arial','I',8);
$pdf->Cell(0,10,"Dicetak Oleh Akuntan : ". user()->name ." Pada ".date("d-m-Y H:i:s")." WITA",0,0,'C');
$pdf->AddPage('L', 'A4');
}
// Save
return $pdf->Output('D', "Laporan Keuangan $periode.pdf");
}
}

View File

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

View File

@ -0,0 +1,79 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use App\Enums\GlobalEnum as Status;
use App\Models\User;
use App\Models\LogActivites;
use App\Models\Akun;
use App\Models\Jurnal;
use Carbon\Carbon;
class DashboardController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Halaman Utama',
];
$akun = Akun::count();
$totalKasBulanIni = \DB::table('tbl_jurnal')->where('waktu_transaksi', 'LIKE', '%'.date('Y-m').'%')->where('tipe', 'd')->sum('nominal');
$totalPengeluaranBulanIni = \DB::table('tbl_jurnal')->where('waktu_transaksi', 'LIKE', '%'.date('Y-m').'%')->where('tipe', 'k')->sum('nominal');
return view('admin.app.dashboard.index', compact('data', 'akun', 'totalKasBulanIni', 'totalPengeluaranBulanIni'));
}
public function profile()
{
$data = [
'subtitle' => 'Akun anda',
];
return view('admin.app.users.setting', compact('data'));
}
public function update(Request $request)
{
$id = user()->id;
$validator = Validator::make($request->all(), [
'name' => 'required',
'email' => 'required',
'phone' => 'required',
'password' => 'string',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$findUser = User::find($id);
if($findUser) {
// update data
$findUser->name = $input['name'];
$findUser->email = $input['email'];
$findUser->phone = $input['phone'];
if(!empty($input['password'])) {
$findUser->password = bcrypt($input['password']);
}
// save data
$findUser->save();
return redirect()->back()->with('success', 'Data berhasil disimpan');
} else {
return redirect()->back()->with('success', 'Tidak ditemukan data!');
}
}
}

View File

@ -0,0 +1,240 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Auth;
// additional modules
use App\Helpers\MailerHelper as Mailers;
use App\Enums\GlobalEnum;
use App\Models\User;
use App\Models\UserManager;
use App\Models\LogActivites;
use Ramsey\Uuid\Uuid;
class LoginController extends Controller
{
public function index()
{
$data = [
'title' => 'CMSQ',
'subtitle' => 'Login',
];
return view('auth/login', compact('data'));
}
public function proses_login(Request $request)
{
$credentials = $request->validate([
'email' => ['required','email'],
'password' => ['required'],
]);
if (Auth::attempt($credentials)) {
$user = Auth::user();
switch($user->level) {
case 1:
LogActivites::default([
'causedBy' => $user->id,
'logType' => GlobalEnum::LogOfLogin,
'withContent' => [
'status' => 'add',
'text' => 'Login as ' . $user->name,
'ip_address' => $request->ip(),
'user_agent' => $request->userAgent(),
'time' => date('Y-m-d H:i:s')
]
]);
return redirect()->intended('app/dashboard');
break;
}
} else {
return redirect()->back()->withInput()->with('error', 'Email atau Password salah!');
}
}
public function logout(Request $request)
{
$request->session()->flush();
Auth::logout();
return redirect('/');
}
public function register()
{
$data = [
'subtitle' => 'Register',
];
return view('auth/register', compact('data'));
}
public function storeRegister(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'email' => 'required|string|email|max:255',
'password' => 'required|min:6',
'level' => 'required',
]);
if ($validator->fails()) {
return back()->with('error', 'Terdapat data yang belum diisi')->withInput();
}
$input = $request->all();
$userEmailToken = md5(Str::random(25));
$user = new User([
'name' => $input['name'],
'username' => Str::before($input['email'], '@') . rand(100, 999),
'email' => $input['email'],
'level' => $input['level'],
'email_verified_token' => NULL,
'password' => bcrypt($input['password']),
'status' => 1
]);
$check = User::where('email', $input['email'])->count();
if($check == 0) {
if($user->save()) {
return redirect()->route('login')->with('success', 'Anda berhasil mendaftarkan diri, silahkan masuk');
} else {
return back()->with('error', 'Terdapat data yang salah')->withInput();
}
} else {
return back()->with('error', 'Data telah ada, Silahkan gunakan email yang lain.')->withInput();
}
}
public function verify($token)
{
$userAccount = User::where('email_verified_token', $token)->first();
if($token == null) {
return redirect()->route('login')->with('swal', swal_alert('error', 'Token tidak ditemukan!'));
} elseif(empty($userAccount) || is_null($userAccount)) {
return redirect()->route('login')->with('swal', swal_alert('error', 'Token sudah digunakan!'));
} elseif($userAccount->status == 1 || $userAccount->email_verified_at != null) {
return redirect()->route('login')->with('swal', swal_alert('error', 'Akun sudah terverifikasi!'));
} else {
// check before update
$user = User::find($userAccount->id);
$user->email_verified_token = null;
$user->email_verified_at = now();
$user->status = 1;
// update
$user->save();
return redirect()->route('login')->with('swal', swal_alert('success', 'Email telah berhasil diverifikasi, anda dapat menggunakan layanan'));
}
}
public function forgot()
{
$data = [
'subtitle' => 'Lupa Kata Sandi',
];
return view('auth/forgot_password', compact('data'));
}
public function forgotPassword(Request $request)
{
$validator = Validator::make($request->all(), [
'email' => 'required|string|email|max:255',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$userEmailToken = md5(Str::random(25));
$user = new UserManager([
'uuid' => Uuid::uuid4(),
'email' => $input['email'],
'token' => $userEmailToken,
'isUsed' => 0,
]);
$check = User::where('email', $input['email'])->count();
$userName = User::where('email', $input['email'])->first()->name;
if($check == 1) {
$sendEmail = Mailers::to($input['email'], false, 'email.auth.forgot_password', [
'message' => 'You have been successfully requested! Please check your email to reset your password',
'subject' => 'Forgot Password',
'name' => $userName,
'token' => $userEmailToken
]);
if($sendEmail) {
$user->save();
return redirect()->route('login')->with('success', 'Check your email to reset your password');
} else {
return back()->with('error', 'Something went wrong!')->withInput();
}
} else {
return back()->with('error', 'Email not found!')->withInput();
}
}
public function reset($token)
{
$findTokenByUsed = UserManager::where('token', $token)->first();
if($findTokenByUsed->isUsed == 1) {
return redirect()->route('login')->with('error', 'Token sudah digunakan!');
} elseif(hasExpired($findTokenByUsed->created_at)) {
return redirect()->route('login')->with('error', 'Token expired!');
}
$data = [
'subtitle' => 'Reset Password',
];
return view('auth/reset_password', compact('data','token'));
}
public function resetPassword(Request $request)
{
$validator = Validator::make($request->all(), [
'password' => 'required|string|min:8',
'retype_password' => 'required|string|min:8',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
if($request->password != $request->retype_password) {
return redirect()->back()->with('error', 'Password tidak sama!')->withInput();
}
$input = $request->all();
$userEmailbyToken = UserManager::where('token', $input['token'])->first();
$findUserByEmail = User::where('email', $userEmailbyToken->email)->first();
// check expired token 60 minutes
if(hasExpired($findUserByEmail->created_at)) {
return redirect()->route('login')->with('error', 'Token expired!');
} else {
// update password
$findUserByEmail->password = bcrypt($input['password']);
$findUserByEmail->save();
// update token
$userEmailbyToken->isUsed = 1;
$userEmailbyToken->save();
return redirect()->route('login')->with('success', 'Password has been reset!');
}
}
}

View File

@ -0,0 +1,207 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use GuzzleHttp\Client;
use Carbon\Carbon;
use App\Models\Produk;
class ProductController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = Produk::select('*');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::of($data)
->addIndexColumn()
->addColumn('harga', function ($row) {
return 'Rp. ' . number_format($row->price, 0, ',', '.');
})
->rawColumns(['harga'])
->make(true);
}
$data = [
'subtitle' => 'Semua Produk',
'button' => true,
'module' => [
'url' => app_url('produk/create'),
'name' => 'Tambah Baru'
]
];
return view('admin.app.content.produk.index', compact('data'));
}
public function create()
{
$data = [
'subtitle' => 'Tambah baru',
];
return view('admin.app.content.produk.add', compact('data'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'stok' => 'required',
'price' => 'required'
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
$input = $request->all();
$post = new Produk([
'name' => $input['name'], // Membersihkan input judul menggunakan Purifier
'stok' => $input['stok'], // Membersihkan input deskripsi menggunakan Purifier
'price' => $input['price']
]);
$check = Produk::where('name', $input['name'])->count();
if ($check == 0) {
if ($post->save()) {
return redirect()->route('produk')->with('success', 'You have successfully added data');
} else {
return redirect()->route('produk')->with('error', 'An error occurred in the query');
}
} else {
return redirect()->route('produk')->with('error', 'Title already exists');
}
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$data = [
'subtitle' => 'Edit Produk'
];
$akun = Produk::FindOrFail($id);
return view('admin.app.content.produk.edit', compact('data', 'id', 'akun'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
// Validasi input sebelum memperbarui data
$validator = Validator::make($request->all(), [
'name' => 'required',
'stok' => 'required',
'price' => 'required'
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
// Cari data berdasarkan ID
$akun = Produk::find($id);
// Jika data ditemukan
if ($akun) {
// Update data dengan data baru dari form yang telah dibersihkan
$akun->name = $request->input('name');
$akun->stok = $request->input('stok');
$akun->price = $request->input('price');
// Simpan perubahan pada database
$akun->save();
return redirect()->route('produk')->with('success', 'You are successfully added new records');
} else {
return redirect()->route('produk')->with('error', 'Unexpected error');
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
// Cari data berdasarkan ID
$post = Produk::find($id);
// Jika data ditemukan
if ($post) {
// Hapus data dari database
$post->delete();
return redirect()->route('produk')->with('success', 'You are successfully deleted records');
} else {
return redirect()->route('produk')->with('error', 'Data not found');
}
}
public function addStockFromSupplier(Request $request)
{
$validator = Validator::make($request->all(), [
'nama_supplier' => 'required',
'nama_produk' => 'required',
'jumlah' => 'required|integer',
'harga' => 'required|numeric'
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
$input = $request->all();
$supplier = new Supplier([
'nama_supplier' => $input['nama_supplier'],
'nama_produk' => $input['nama_produk'],
'jumlah' => $input['jumlah'],
'harga' => $input['harga']
]);
if ($supplier->save()) {
$product = Produk::where('name', $input['nama_produk'])->first();
if ($product) {
$product->stok += $input['jumlah'];
$product->save();
return redirect()->route('produk')->with('success', 'Stock successfully added from supplier');
} else {
return redirect()->route('produk')->with('error', 'Product not found');
}
} else {
return redirect()->route('produk')->with('error', 'An error occurred while saving supplier data');
}
}
}

View File

@ -0,0 +1,155 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Supplier;
use App\Models\Produk;
use App\Models\Jurnal;
use Illuminate\Support\Facades\Validator;
class SupplierController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Suppliers',
'button' => true,
'module' => [
'url' => route('suppliers.create'),
'name' => 'Tambah Baru'
]
];
$suppliers = Supplier::all();
return view('suppliers.index', compact('suppliers', 'data'));
}
public function create()
{
$data = [
'subtitle' => 'Suppliers',
'button' => true,
'module' => [
'url' => route('suppliers.create'),
'name' => 'Tambah Baru'
]
];
$products = Produk::all();
return view('suppliers.create', compact('data', 'products' ));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'nama_supplier' => 'required',
'nama_produk' => 'required',
'jumlah' => 'required|integer',
'harga' => 'required|numeric',
'payment_method' => 'required|in:cash,hutang',
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
// Membuat entri supplier
$supplier = Supplier::create($request->all());
// Memperbarui stok produk
$produk = Produk::where('name', $request->nama_produk)->first();
if ($produk) {
$produk->stok += $request->jumlah;
$produk->save();
} else {
return redirect()->route('suppliers.index')->with('error', 'Produk tidak ditemukan');
}
// Mencatat transaksi di jurnal umum
$this->createJurnalEntry($request);
return redirect()->route('suppliers.index')->with('success', 'Supplier berhasil dibuat dan stok produk berhasil diperbarui.');
}
private function createJurnalEntry(Request $request)
{
$persediaanAkunId = 3; // Ganti dengan ID akun persediaan yang benar
$hutangUsahaAkunId = 14; // Ganti dengan ID akun hutang usaha yang benar
$kasAkunId = 1; // Ganti dengan ID akun kas/bank yang benar
$isCashPayment = $request->payment_method === 'cash'; // Periksa metode pembayaran
$reff = $this->generateRandomString();
// Mencatat debit ke akun persediaan
Jurnal::create([
'id_akun' => $persediaanAkunId,
'no_reff' => $reff,
'keterangan' => 'Pembelian persediaan dari supplier ' . $request->nama_supplier,
'waktu_transaksi' => now(),
'nominal' => $request->harga * $request->jumlah,
'tipe' => 'd' // 'd' untuk debit
]);
if ($isCashPayment) {
// Mencatat kredit ke akun kas untuk pembayaran tunai
Jurnal::create([
'id_akun' => $kasAkunId,
'no_reff' => $reff,
'keterangan' => 'Pembayaran tunai untuk pembelian persediaan dari supplier ' . $request->nama_supplier,
'waktu_transaksi' => now(),
'nominal' => $request->harga * $request->jumlah,
'tipe' => 'k' // 'k' untuk kredit
]);
} else {
// Mencatat kredit ke akun hutang usaha untuk pembayaran kredit
Jurnal::create([
'id_akun' => $hutangUsahaAkunId,
'no_reff' => $reff,
'keterangan' => 'Hutang untuk pembelian persediaan dari supplier ' . $request->nama_supplier,
'waktu_transaksi' => now(),
'nominal' => $request->harga * $request->jumlah,
'tipe' => 'k' // 'k' untuk kredit
]);
}
}
public function show(Supplier $supplier)
{
return view('suppliers.show', compact('supplier'));
}
public function edit(Supplier $supplier)
{
return view('suppliers.edit', compact('supplier'));
}
public function update(Request $request, Supplier $supplier)
{
$request->validate([
'nama_supplier' => 'required',
'nama_produk' => 'required',
'jumlah' => 'required|integer',
'harga' => 'required|numeric',
]);
$supplier->update($request->all());
return redirect()->route('suppliers.index')->with('success', 'Supplier updated successfully.');
}
public function destroy(Supplier $supplier)
{
$supplier->delete();
return redirect()->route('suppliers.index')->with('success', 'Supplier deleted successfully.');
}
function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
}

View File

@ -0,0 +1,309 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use GuzzleHttp\Client;
use Carbon\Carbon;
use App\Models\{Transaksi, Produk, Jurnal, Supplier};
class TransactionController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = Transaksi::select('*');
return Datatables::of($data)
->addIndexColumn()
->addColumn('name', function ($row) {
$product = Produk::find($row->id_product);
return $product ? $product->name : 'Product not found';
})
->addColumn('total', function ($row) {
return 'Rp. ' . number_format($row->total, 0, ',', '.');
})
->addColumn('payment_method', function ($row) {
return ucfirst($row->payment_method);
})
->addColumn('status', function ($row) {
return $row->status;
})
->addColumn('action', function ($row) {
$action = '';
if ($row->payment_method=="hutang" && $row->status == 'unpaid') {
$action = '<a href="'.route('transaksi.piutang', $row->id).'" class="btn btn-primary">Lunasi Hutang</a>';
} else {
$action = '<span class="badge badge-success">Lunas</span>';
}
return $action;
})
->rawColumns(['total', 'name', 'payment_method', 'status', 'action'])
->make(true);
}
$data = [
'subtitle' => 'Semua Transaksi',
'button' => true,
'module' => [
'url' => app_url('transaksi/create'),
'name' => 'Tambah Baru'
]
];
return view('admin.app.content.transaction.index', compact('data'));
}
public function create()
{
$data = [
'subtitle' => 'Tambah baru',
];
return view('admin.app.content.transaction.add', compact('data'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'id_product' => 'required',
'qty' => 'required',
'payment_method' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
$input = $request->all();
$check_product = Produk::where('id', $request->input('id_product'))->first();
if ($check_product) {
if ($check_product->stok < $input['qty']) {
return redirect()->back()->withInput()->with('error', 'Stok tidak cukup.');
}
$post = new Transaksi([
'id_product' => $input['id_product'],
'qty' => $input['qty'],
'total' => $input['qty'] * $check_product->price,
'payment_method' => $input['payment_method'],
]);
if ($post->save()) {
$check_product->stok -= $input['qty'];
$check_product->save();
$account_id = $input['payment_method'] === 'cash' ? 1 : 2; // ID akun 4 untuk Pendapatan, 6 untuk Hutang Usaha
$reff = $this->generateRandomString();
$addToJurnal = new Jurnal([
'keterangan' => 'Pembelian ' . $check_product->name,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => $input['qty'] * $check_product->price,
'tipe' => 'd',
'id_akun' => $account_id,
]);
$addToJurnal->save();
$paymentJournal = new Jurnal([
'keterangan' => 'Pembayaran ' . $check_product->name,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => $input['qty'] * $check_product->price,
'tipe' => 'k',
'id_akun' => 9,
]);
$paymentJournal->save();
return redirect()->route('transaksi')->with('success', 'Transaksi berhasil ditambahkan');
} else {
return redirect()->route('transaksi')->with('error', 'Transaksi gagal ditambahkan');
}
} else {
return redirect()->route('transaksi')->with('error', 'Product tidak ditemukan');
}
}
public function destroy($id)
{
// Cari data berdasarkan ID
$post = Transaksi::find($id);
// Jika data ditemukan
if ($post) {
// Hapus data dari database
$checkProduk = Produk::where('id', $post->id_product)->first();
$checkJurnal = Jurnal::where('keterangan', 'LIKE', '%Pembelian ' . $checkProduk->name . '%')->first();
if($checkJurnal) $checkJurnal->delete();
$post->delete();
return redirect()->route('produk')->with('success', 'Data deleted successfully');
} else {
return redirect()->route('produk')->with('error', 'Data not found');
}
}
function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
public function bayar_hutang($id)
{
// Cari transaksi berdasarkan ID
$supplier = Supplier::find($id);
// Jika supplier tidak ditemukan atau sudah lunas
if (!$supplier || $supplier->status == 'paid') {
return redirect()->route('suppliers.index')->with('error', 'Supplier tidak ditemukan atau sudah lunas');
}
// Update status transaksi menjadi lunas
$supplier->status = 'paid';
$supplier->save();
// Tambahkan entri jurnal untuk pelunasan hutang
$reff = $this->generateRandomString();
$paymentJournal = new Jurnal([
'keterangan' => 'Pelunasan Hutang ' . $supplier->nama_produk,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => ($supplier->jumlah*$supplier->harga),
'tipe' => 'd',
'id_akun' => 14, // ID akun untuk Hutang Usaha
]);
$paymentJournal->save();
$paymentJournal2 = new Jurnal([
'keterangan' => 'Pelunasan Hutang ' . $supplier->nama_produk,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => ($supplier->jumlah*$supplier->harga),
'tipe' => 'k',
'id_akun' => 1, // ID akun untuk Hutang Usaha
]);
$paymentJournal2->save();
return redirect()->route('suppliers.index')->with('success', 'Hutang berhasil dilunasi');
}
public function bayar_piutang($id)
{
// Cari transaksi berdasarkan ID
$transaction = Transaksi::select('tbl_transaksi.*', 'tbl_produk.name')->leftJoin('tbl_produk', 'id_product', 'tbl_produk.id')
->where('tbl_transaksi.id', $id)->first();
// Jika transaction tidak ditemukan atau sudah lunas
if (!$transaction || $transaction->status == 'paid') {
return redirect()->route('transaksi')->with('error', 'Trabsaksi tidak ditemukan atau sudah lunas');
}
// Update status transaksi menjadi lunas
$transaction->status = 'paid';
$transaction->save();
// Tambahkan entri jurnal untuk pelunasan hutang
$reff = $this->generateRandomString();
$paymentJournal = new Jurnal([
'keterangan' => 'Pembayaran Piutang ' . $transaction->name,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => ($transaction->total),
'tipe' => 'd',
'id_akun' => 1,
]);
$paymentJournal->save();
$paymentJournal2 = new Jurnal([
'keterangan' => 'Pembayaran Piutang ' . $transaction->name,
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => ($transaction->total),
'tipe' => 'k',
'id_akun' => 2,
]);
$paymentJournal2->save();
return redirect()->route('transaksi')->with('success', 'Piutang berhasil dibayar');
}
public function beban(Request $request)
{
$data = [
'subtitle' => 'Beban Operasional',
'button' => true,
'module' => [
'url' => app_url('beban'),
'name' => 'Tambah Baru'
]
];
return view('admin.app.content.transaction.beban', compact('data'));
}
public function tambah_beban(Request $request)
{
$validator = Validator::make($request->all(), [
'keterangan' => 'required',
'nominal' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withInput()->with('error', 'Unexpected error, please try again. code: ' . $validator->errors()->first());
}
$input = $request->all();
$reff = $this->generateRandomString();
$addToJurnal = new Jurnal([
'keterangan' => $input['keterangan'],
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => $input['nominal'],
'tipe' => 'd',
'id_akun' => 15,
]);
$addToJurnal->save();
$paymentJournal = new Jurnal([
'keterangan' => $input['keterangan'],
'waktu_transaksi' => Carbon::now(),
'no_reff' => $reff,
'nominal' => $input['nominal'],
'tipe' => 'k',
'id_akun' => 1,
]);
$paymentJournal->save();
return redirect()->route('jurnal-umum')->with('success', 'Beban Operasional Berhasil Ditambahkan');
}
}

View File

@ -0,0 +1,262 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use App\Models\User;
use App\Models\Roles;
use Modules\Seller\Entities\AccountModel;
use App\Enums\GlobalEnum;
use App\Models\LogActivites;
use App\Helpers\MailerHelper as Mailers;
use DataTables;
use Carbon\Carbon;
class UsersController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = User::select('*')->whereIn('level', [1,2])->orderBy('created_at', 'desc');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::eloquent($data)
->addIndexColumn()
->addColumn('title-post', function($row) {
return '
<div class="d-flex align-items-center">
<div class="symbol symbol-25px symbol-circle">
<div class="symbol-label" style="background-image:url(' . gravatar_team($row->email) . ')"></div>
</div>
<div class="ms-3"><span>' . $row->name . '</span></div>
</div>
';
})
->addColumn('action', function($row){
$view = route('users.show', ['id' => $row->id]);
$edit = route('users.edit', ['id' => $row->id]);
$delete = route('users.delete', ['id' => $row->id]);
$btn = '
<a href="' . $view . '" class="btn btn-light btn-sm px-4"><i class="ki-outline ki-eye"></i></a>
<a href="' . $edit . '" class="btn btn-light btn-sm px-4"><i class="ki-outline ki-pencil"></i></a>
<a data-url="' . $delete . '" href="#" class="btn btn-light btn-sm deleteContent px-4"><i class="ki-outline ki-trash"></i></a>
';
return $btn;
})
->addColumn('status', function($row){
if ($row->status == GlobalEnum::isActive) {
return '<span class="mb-1 badge font-medium badge-success py-2 px-3 fs-7">Active</span>';
} elseif($row->status == GlobalEnum::isInactive) {
return '<span class="mb-1 badge font-medium badge-primary py-2 px-3 fs-7">Non Active</span>';
} elseif($row->status == GlobalEnum::isDeactive) {
return '<span class="mb-1 badge font-medium badge-danger py-2 px-3 fs-7">Deactivated</span>';
} else {
return '<span class="mb-1 badge font-medium badge-warning py-2 px-3 fs-7">Not Verified</span>';
}
})
->rawColumns(['title-post','action','status'])
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('status', '=', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'user') {
if(!empty($filterCategory[1])) {
$query->where('name', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->make(true);
}
$data = [
'subtitle' => 'Users',
'button' => true,
'module' => [
'url' => route('users.create'),
'name' => 'Create New'
]
];
return view('admin.app.users.index', compact('data'));
}
public function create()
{
$data = [
'subtitle' => 'Create New'
];
$roles = Roles::whereIn('id', [1,2])->get();
return view('admin.app.users.add', compact('data', 'roles'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'email' => 'required|email',
'status' => 'required',
'level' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$foto_namaBaru = null;
$userEmailToken = md5(Str::random(25));
$post = new User([
'name' => $input['name'],
'username' => Str::before($input['email'], '@') . rand(100, 999),
'email' => $input['email'],
'password' => empty($input['password']) ? bcrypt('default123') : bcrypt($input['password']),
'status' => $input['status'],
'level' => $input['level'],
'thumbnail' => empty($foto_namaBaru) ? '' : $foto_namaBaru,
]);
$check = User::where('email', $input['email'])->count();
// $insertLog = LogActivites::default([
// 'causedBy' => user()->id,
// 'logType' => GlobalEnum::LogOfGeneral,
// 'withContent' => [
// 'status' => 'add',
// 'text' => 'Insert a new user with email ' . $input['email'],
// ]
// ]);
if ($check == 0) {
$sendEmail = Mailers::to($input['email'], false, 'email.auth.register', [
'message' => 'Anda telah berhasil didaftarkan, silahkan catat akun anda',
'subject' => 'Pendaftaran Pengguna',
'name' => $input['name'],
'email' => $input['email'],
'password' => empty($input['password']) ? 'default123' : $input['password'],
'token' => $userEmailToken
]);
if ($post->save()) {
if($sendEmail) {
return redirect()->route('users')->with('success', 'You have successfully added data');
} else {
return redirect()->route('users')->with('error', 'An error occurred in the query email');
}
} else {
return redirect()->route('users')->with('error', 'An error occurred in the query');
}
} else {
return redirect()->route('users')->with('error', 'Email already exists');
}
}
public function show($id)
{
$data = [
'subtitle' => User::where('id', $id)->first()->email,
'records' => User::where('id', $id)->first(),
'logs' => User::where('id', $id)->first()
];
return view('admin.app.users.detail', compact('data'));
}
public function edit($id)
{
$data = [
'subtitle' => User::where('id', $id)->first()->email,
'records' => User::where('id', $id)->first()
];
$roles = Roles::whereIn('id', [1,2])->get();
return view('admin.app.users.edit', compact('data', 'id', 'roles'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'email' => 'required|email',
'level' => 'required',
'status' => 'required',
'image' => 'image|mimes:jpg,jpeg,png,svg|max:7048',
], [
'image.mimes' => 'Tipe file yang diunggah harus jpg, jpeg, png, atau svg.',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
// Cari data berdasarkan ID
$user = User::find($id);
// Jika data ditemukan
if ($user) {
// Jika ada file baru yang diunggah, hapus file thumbnail yang lama
if ($request->hasFile('image') && $request->file('image')->isValid()) {
if ($user->thumbnail) {
Storage::delete($user->thumbnail);
}
}
// Update data dengan data baru dari form yang telah dibersihkan
$user->name = $request->input('name');
$user->email = $request->input('email');
!empty($request->input('password')) ? $user->password = bcrypt($request->input('password')) : $user->password;
$user->level = $request->input('level');
$user->status = $request->input('status');
$user->username = Str::before($user->email, '@') . rand(100, 999);
// Jika ada file baru yang diunggah, simpan file baru di storage
if ($request->hasFile('image') && $request->file('image')->isValid()) {
$foto_namaBaru = $request->file('image')->store('public/images');
$user->thumbnail = $foto_namaBaru;
}
// Simpan perubahan pada database
$user->save();
return redirect()->route('users')->with('swal', swal_alert('success', 'You are successfully modify data'));
} else {
return redirect()->route('users')->with('swal', swal_alert('error', 'Unexpected error'));
}
}
public function destroy($id)
{
$user = User::find($id);
// Jika data ditemukan
if ($user) {
// Cek apakah ada file di kolom "is_thumbnail"
if ($user->thumbnail) {
// Hapus file thumbnail dari storage
Storage::delete($user->is_thumbnail);
}
// Hapus data dari database
$user->delete();
return redirect()->route('users')->with('swal', swal_alert('success', 'You are successfully deleted records'));
} else {
return redirect()->route('users')->with('swal', swal_alert('error', 'Data not found'));
}
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'check.status' => \App\Http\Middleware\CheckUserStatus::class,
'check.admin' => \App\Http\Middleware\CheckAuthenticatedisAdmin::class,
'check.seller' => \App\Http\Middleware\CheckSeller::class,
'XssSanitization' => \App\Http\Middleware\XssSanitization::class,
'check.auth' => \App\Http\Middleware\isAuth::class
];
}

View File

@ -0,0 +1,78 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use App\Models\Content;
use App\Models\ContentCategories as Category;
use App\Enums\GlobalEnum;
use WithPagination;
class Blog extends Component
{
public $filterType;
public $categoryFilter;
public $searchFilter = '';
public $currentPage = 1;
public $perPage = 10;
public function render(Request $request)
{
$valueCategory = '';
if(!empty($request->input('categoryFilter')))
{
$this->categoryFilter = $request->categoryFilter;
$valueCategory = $request->categoryFilter;
}
$query = Content::where('is_status', 1);
if (!empty($this->categoryFilter)) {
$query->where('is_category', 'like', '%' . $this->categoryFilter . '%');
}
if (!empty($this->searchFilter)) {
$query->where('title', 'like', '%' . $this->searchFilter . '%');
}
$sites = $query->paginate($this->perPage)->appends([
'categoryFilter' => $this->categoryFilter,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
$getListCategory = Category::select('*');
return view('livewire.modules.user.blog',
compact('sites', 'elements', 'searchCount', 'getListCategory', 'valueCategory')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.sites.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Modules\Seller\Entities\DomainModel as Domains;
use Modules\User\Entities\CartModel as Carts;
use App\Enums\GlobalEnum;
use WithPagination;
class Domain extends Component
{
public $searchFilter = '';
public $minimumPrice;
public $maximumPrice;
public $currentPage = 1;
public $perPage = 10;
public function render(Request $request)
{
$valueMinimumPrice = '';
$valueMaximumPrice = '';
if(!empty($request->input('minimumPrice')) || !empty($request->input('maximumPrice')))
{
$this->minimumPrice = $request->minimumPrice;
$this->maximumPrice = $request->maximumPrice;
$valueMinimumPrice = $request->minimumPrice;
$valueMaximumPrice = $request->maximumPrice;
}
$query = Domains::where('is_status', GlobalEnum::isSiteActive);
if (!empty($this->minimumPrice) || !empty($this->maximumPrice)) {
$query->whereBetween('is_post_price', [$this->minimumPrice, $this->maximumPrice]);
}
if (!empty($this->searchFilter)) {
$check_query = $query->where('url', 'like', '%' . $this->searchFilter . '%')->count();
if($check_query == 0) {
$query->where('is_url_from_website', 'like', '%' . $this->searchFilter . '%');
} else {
$query->where('url', 'like', '%' . $this->searchFilter . '%');
}
}
$sites = $query->paginate($this->perPage)->appends([
'minimumPrice' => $this->minimumPrice,
'maximumPrice' => $this->maximumPrice,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
return view('livewire.modules.user.domain',
compact('sites', 'elements', 'searchCount', 'valueMinimumPrice', 'valueMaximumPrice')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.domain.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Modules\Seller\Entities\DomainModel as Domains;
use Modules\User\Entities\CartModel as Carts;
use App\Enums\GlobalEnum;
use WithPagination;
class DomainPremium extends Component
{
public $searchFilter = '';
public $minimumPrice;
public $maximumPrice;
public $currentPage = 1;
public $perPage = 10;
public function render(Request $request)
{
$valueMinimumPrice = '';
$valueMaximumPrice = '';
if(!empty($request->input('minimumPrice')) || !empty($request->input('maximumPrice')))
{
$this->minimumPrice = $request->minimumPrice;
$this->maximumPrice = $request->maximumPrice;
$valueMinimumPrice = $request->minimumPrice;
$valueMaximumPrice = $request->maximumPrice;
}
$query = Domains::where('is_status', GlobalEnum::isSiteActive)->where('is_premium', 1);
if (!empty($this->minimumPrice) || !empty($this->maximumPrice)) {
$query->whereBetween('is_post_price', [$this->minimumPrice, $this->maximumPrice]);
}
if (!empty($this->searchFilter)) {
$check_query = $query->where('url', 'like', '%' . $this->searchFilter . '%')->count();
if($check_query == 0) {
$query->where('is_url_from_website', 'like', '%' . $this->searchFilter . '%');
} else {
$query->where('url', 'like', '%' . $this->searchFilter . '%');
}
}
$sites = $query->paginate($this->perPage)->appends([
'minimumPrice' => $this->minimumPrice,
'maximumPrice' => $this->maximumPrice,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
return view('livewire.modules.user.domain-premium',
compact('sites', 'elements', 'searchCount', 'valueMinimumPrice', 'valueMaximumPrice')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.domain.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

@ -0,0 +1,101 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Modules\Seller\Entities\SitesModel as Sites;
use Modules\Seller\Entities\SitesCategoryModel as SitesCategory;
use Modules\User\Entities\CartModel as Carts;
use App\Enums\GlobalEnum;
use WithPagination;
class Listing extends Component
{
public $filterType;
public $categoryFilter;
public $searchFilter = '';
public $minimumPrice;
public $maximumPrice;
public $currentPage = 1;
public $perPage = 12;
public function render(Request $request)
{
$valueType = '';
$valueCategory = '';
$valueMinimumPrice = '';
$valueMaximumPrice = '';
if(!empty($request->input('filterType')) || !empty($request->input('categoryFilter')) || !empty($request->input('minimumPrice')) || !empty($request->input('maximumPrice')))
{
$this->filterType = $request->filterType;
$this->categoryFilter = $request->categoryFilter;
$this->minimumPrice = $request->minimumPrice;
$this->maximumPrice = $request->maximumPrice;
$valueType = $request->filterType;
$valueCategory = $request->categoryFilter;
$valueMinimumPrice = $request->minimumPrice;
$valueMaximumPrice = $request->maximumPrice;
}
$query = Sites::where('is_status', GlobalEnum::isSiteActive);
if (!empty($this->filterType)) {
$query->where('is_type', $this->filterType);
}
if (!empty($this->categoryFilter)) {
$query->where('is_url_category', 'like', '%' . $this->categoryFilter . '%');
}
if (!empty($this->minimumPrice) || !empty($this->maximumPrice)) {
$query->whereBetween('is_post_price', [$this->minimumPrice, $this->maximumPrice]);
}
if (!empty($this->searchFilter)) {
$query->where('url', 'like', '%' . $this->searchFilter . '%');
}
$sites = $query->paginate($this->perPage)->appends([
'filterType' => $this->filterType,
'categoryFilter' => $this->categoryFilter,
'minimumPrice' => $this->minimumPrice,
'maximumPrice' => $this->maximumPrice,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
$getListCategory = SitesCategory::where('is_status', GlobalEnum::isActive)->get();
return view('livewire.modules.user.product',
compact('sites', 'elements', 'searchCount', 'getListCategory', 'valueType', 'valueCategory', 'valueMinimumPrice', 'valueMaximumPrice')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.sites.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

@ -0,0 +1,102 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Modules\Seller\Entities\SitesModel as Sites;
use Modules\Seller\Entities\SitesCategoryModel as SitesCategory;
use Modules\User\Entities\CartModel as Carts;
use App\Enums\GlobalEnum;
use WithPagination;
class Site extends Component
{
public $filterType;
public $categoryFilter;
public $searchFilter = '';
public $minimumPrice;
public $maximumPrice;
public $currentPage = 1;
public $perPage = 10;
public function render(Request $request)
{
$valueType = '';
$valueCategory = '';
$valueMinimumPrice = '';
$valueMaximumPrice = '';
if(!empty($request->input('filterType')) || !empty($request->input('categoryFilter')) || !empty($request->input('minimumPrice')) || !empty($request->input('maximumPrice')))
{
$this->filterType = $request->filterType;
$this->categoryFilter = $request->categoryFilter;
$this->minimumPrice = $request->minimumPrice;
$this->maximumPrice = $request->maximumPrice;
$valueType = $request->filterType;
$valueCategory = $request->categoryFilter;
$valueMinimumPrice = $request->minimumPrice;
$valueMaximumPrice = $request->maximumPrice;
}
$query = Sites::where('is_status', GlobalEnum::isSiteActive);
if (!empty($this->filterType)) {
$query->where('is_type', $this->filterType);
}
if (!empty($this->categoryFilter)) {
$query->where('is_url_category', 'like', '%' . $this->categoryFilter . '%');
}
if (!empty($this->minimumPrice) || !empty($this->maximumPrice)) {
$query->whereBetween('is_post_price', [$this->minimumPrice, $this->maximumPrice]);
}
if (!empty($this->searchFilter)) {
$query->where('url', 'like', '%' . $this->searchFilter . '%');
}
$sites = $query->paginate($this->perPage)->appends([
'filterType' => $this->filterType,
'categoryFilter' => $this->categoryFilter,
'minimumPrice' => $this->minimumPrice,
'maximumPrice' => $this->maximumPrice,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
$getListCategory = SitesCategory::where('is_status', GlobalEnum::isActive)->get();
return view('livewire.modules.user.site',
compact('sites', 'elements', 'searchCount', 'getListCategory', 'valueType', 'valueCategory', 'valueMinimumPrice', 'valueMaximumPrice')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.sites.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

@ -0,0 +1,102 @@
<?php
namespace App\Http\Livewire\Modules\User;
use Livewire\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Modules\Seller\Entities\SitesModel as Sites;
use Modules\Seller\Entities\SitesCategoryModel as SitesCategory;
use Modules\User\Entities\CartModel as Carts;
use App\Enums\GlobalEnum;
use WithPagination;
class SitePremium extends Component
{
public $filterType;
public $categoryFilter;
public $searchFilter = '';
public $minimumPrice;
public $maximumPrice;
public $currentPage = 1;
public $perPage = 10;
public function render(Request $request)
{
$valueType = '';
$valueCategory = '';
$valueMinimumPrice = '';
$valueMaximumPrice = '';
if(!empty($request->input('filterType')) || !empty($request->input('categoryFilter')) || !empty($request->input('minimumPrice')) || !empty($request->input('maximumPrice')))
{
$this->filterType = $request->filterType;
$this->categoryFilter = $request->categoryFilter;
$this->minimumPrice = $request->minimumPrice;
$this->maximumPrice = $request->maximumPrice;
$valueType = $request->filterType;
$valueCategory = $request->categoryFilter;
$valueMinimumPrice = $request->minimumPrice;
$valueMaximumPrice = $request->maximumPrice;
}
$query = Sites::where('is_status', GlobalEnum::isSiteActive)->where('is_premium', 1);
if (!empty($this->filterType)) {
$query->where('is_type', $this->filterType);
}
if (!empty($this->categoryFilter)) {
$query->where('is_url_category', 'like', '%' . $this->categoryFilter . '%');
}
if (!empty($this->minimumPrice) || !empty($this->maximumPrice)) {
$query->whereBetween('is_post_price', [$this->minimumPrice, $this->maximumPrice]);
}
if (!empty($this->searchFilter)) {
$query->where('url', 'like', '%' . $this->searchFilter . '%');
}
$sites = $query->paginate($this->perPage)->appends([
'filterType' => $this->filterType,
'categoryFilter' => $this->categoryFilter,
'minimumPrice' => $this->minimumPrice,
'maximumPrice' => $this->maximumPrice,
]);
$elements = $sites->links()->elements;
$searchCount = $sites->total();
$getListCategory = SitesCategory::where('is_status', GlobalEnum::isActive)->get();
return view('livewire.modules.user.site-premium',
compact('sites', 'elements', 'searchCount', 'getListCategory', 'valueType', 'valueCategory', 'valueMinimumPrice', 'valueMaximumPrice')
);
}
public function previousPage()
{
if ($this->currentPage > 1) {
$this->currentPage--;
}
}
public function nextPage()
{
$this->currentPage++;
}
public function goToPage($page)
{
$url = route('user.sites.view', ['id' => $page]);
return redirect()->to($url);
}
}

View File

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

View File

@ -0,0 +1,32 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
class CheckAuthenticatedisAdmin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
if (Auth::check()) {
$user = Auth::user();
// Check the user's status
if ($user->level != 1) {
return redirect()->intended('user');
}
}
return $next($request);
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class checkUserStatus
{
public function handle($request, Closure $next)
{
// Check if the user is authenticated
if (Auth::check()) {
$user = Auth::user();
// Check the user's status
if ($user->status !== 3) {
return back()
->with('swal', swal_alert('error', 'Akun anda dinonaktifkan, Mohon Kontak administrator'));
}
}
return $next($request);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class XssSanitization
{
/**
* Handles the request by modifying the input data and passing it to the next middleware or route handler.
*
* @param Request $request The request object containing the input data.
* @param Closure $next The next middleware or route handler.
* @throws Some_Exception_Class [Optional] Description of any exception that may be thrown.
* @return mixed The result of the next middleware or route handler.
*/
public function handle(Request $request, Closure $next)
{
$input = $request->all();
array_walk_recursive($input, function(&$input) {
$input = strip_tags($input);
});
$request->merge($input);
return $next($request);
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class isAuth
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
$auth = Auth::check();
if($auth) {
$user = Auth::user();
switch($user->level == 1) {
case 1:
return redirect()->intended('app/dashboard');
break;
case 2:
return redirect()->intended('user');
break;
}
}
return $next($request);
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AkunRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'nama_akun' => 'required|string|unique:akun|max:100',
'kode_akun' => 'required|string|max:5',
];
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class JurnalRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'keterangan' => 'required|string|max:255',
'waktu_transaksi' => 'required|date',
'nominal' => 'required|integer',
'tipe' => 'required|in:d,k',
'id_akun' => 'required|max:10',
];
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Akun extends Model
{
// Nama table tidak ikuti Convention Laravel
protected $table = 'tbl_akun';
protected $primaryKey = 'id';
// kolom tabel untuk Mass Assingment
protected $fillable = ['nama_akun', 'kode_akun'];
// relasi 1-N dengan Jurnal
public function jurnal(){
return $this->hasMany(Jurnal::class, 'id_akun');
}
// Non-aktifkan Timestamp
public $timestamps = false;
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Jurnal extends Model
{
// nama table tidak mengikuti konvensi laravel
protected $table = 'tbl_jurnal';
protected $primaryKey = 'id';
// Non-aktifkan Timestamp
public $timestamps = false;
// kolom tabel untuk Mass Assingment
protected $fillable = ['keterangan', 'waktu_transaksi', 'nominal', 'tipe', 'id_akun', 'no_reff'];
// kolom akan disembunyikan dalam array
protected $hidden = [''];
// Relasi N-1 antara akun dengan jurnal
public function akun(){
return $this->belongsTo(Akun::class, 'id_akun');
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Ramsey\Uuid\Uuid;
use Carbon\Carbon;
class LogActivites extends Model
{
use HasFactory;
protected $table = 'tbl_log_activity';
protected $fillable = ['uid','logType','causedBy','performedOn','withContent','created_at'];
public $timestamps = false;
public static function default($args = [])
{
self::create([
'uid' => Uuid::uuid4()->toString(),
'logType' => $args['logType'],
'causedBy' => $args['causedBy'],
'performedOn' => Carbon::now(),
'withContent' => json_encode($args['withContent'], true),
]);
}
public function user()
{
return $this->hasMany(User::class, 'id', 'causedBy');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Produk extends Model
{
// Nama table tidak ikuti Convention Laravel
protected $table = 'tbl_produk';
protected $primaryKey = 'id';
// kolom tabel untuk Mass Assingment
protected $fillable = ['id', 'name', 'stok', 'price'];
protected $hidden = ['created_at', 'updated_at'];
// Non-aktifkan Timestamp
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\User;
class Roles extends Model
{
use HasFactory;
protected $table = 'tbl_role';
protected $fillable = ['id','name'];
public $timestamps = false;
}

View File

@ -0,0 +1,16 @@
<?php
// Di App\Models\Supplier.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Supplier extends Model
{
protected $fillable = ['nama_supplier', 'nama_produk', 'jumlah', 'harga', 'payment_method', 'pelunasan_piutang'];
public function produk()
{
return $this->belongsTo(Produk::class, 'nama_produk', 'name');
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Transaksi extends Model
{
// Nama table tidak ikuti Convention Laravel
protected $table = 'tbl_transaksi';
protected $primaryKey = 'id';
// kolom tabel untuk Mass Assingment
protected $fillable = ['id', 'id_product', 'total', 'qty', 'payment_method'];
protected $hidden = ['created_at', 'updated_at'];
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use App\Models\Permission;
use App\Models\Roles;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
protected $table = 'tbl_users';
protected $fillable = ['password','username','name','email','email_verified_token','email_verified_at','phone','status','remember_token','thumbnail','level'];
protected $hidden = [
'password',
'remember_token',
];
protected $casts = [
'email_verified_at' => 'datetime',
];
public $timestamps = false;
public function permission()
{
return $this->hasMany(Permission::class);
}
public function roles()
{
return $this->hasMany(Roles::class);
}
public function konselor()
{
return $this->hasMany(Konselor::class);
}
public function siswa()
{
return $this->hasMany(Siswa::class);
}
public function wali()
{
return $this->hasMany(Wali::class);
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserManager extends Model
{
use HasFactory;
protected $table = 'password_resets';
protected $fillable = [
'uuid',
'email',
'token',
'created_at',
'isUsed'
];
protected $primaryKey = 'uuid';
protected $hidden = ['created_at'];
public $timestamps = false;
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Auth;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
public function boot()
{
}
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,63 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\View\Components\theme\auth;
use Illuminate\View\Component;
class Authentication__Footer extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
return view('components.theme.auth.authentication__-footer');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\View\Components\theme\auth;
use Illuminate\View\Component;
class Authentication__Header extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public $data;
public function __construct()
{
$this->data = $data;
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
return view('components.theme.auth.authentication__-header');
}
}

53
bangunan testing/artisan Normal file
View File

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

View File

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

View File

@ -0,0 +1,154 @@
<?php return array (
'crabbly/fpdf-laravel' =>
array (
'providers' =>
array (
0 => 'Crabbly\\Fpdf\\FpdfServiceProvider',
),
),
'darryldecode/cart' =>
array (
'providers' =>
array (
0 => 'Darryldecode\\Cart\\CartServiceProvider',
),
'aliases' =>
array (
'Cart' => 'Darryldecode\\Cart\\Facades\\CartFacade',
),
),
'facade/ignition' =>
array (
'providers' =>
array (
0 => 'Facade\\Ignition\\IgnitionServiceProvider',
),
'aliases' =>
array (
'Flare' => 'Facade\\Ignition\\Facades\\Flare',
),
),
'fruitcake/laravel-cors' =>
array (
'providers' =>
array (
0 => 'Fruitcake\\Cors\\CorsServiceProvider',
),
),
'laravel/sail' =>
array (
'providers' =>
array (
0 => 'Laravel\\Sail\\SailServiceProvider',
),
),
'laravel/sanctum' =>
array (
'providers' =>
array (
0 => 'Laravel\\Sanctum\\SanctumServiceProvider',
),
),
'laravel/tinker' =>
array (
'providers' =>
array (
0 => 'Laravel\\Tinker\\TinkerServiceProvider',
),
),
'laravelcollective/html' =>
array (
'providers' =>
array (
0 => 'Collective\\Html\\HtmlServiceProvider',
),
'aliases' =>
array (
'Form' => 'Collective\\Html\\FormFacade',
'Html' => 'Collective\\Html\\HtmlFacade',
),
),
'livewire/livewire' =>
array (
'providers' =>
array (
0 => 'Livewire\\LivewireServiceProvider',
),
'aliases' =>
array (
'Livewire' => 'Livewire\\Livewire',
),
),
'mad-web/laravel-enum' =>
array (
'providers' =>
array (
0 => 'MadWeb\\Enum\\EnumServiceProvider',
),
),
'mews/purifier' =>
array (
'providers' =>
array (
0 => 'Mews\\Purifier\\PurifierServiceProvider',
),
'aliases' =>
array (
'Purifier' => 'Mews\\Purifier\\Facades\\Purifier',
),
),
'nesbot/carbon' =>
array (
'providers' =>
array (
0 => 'Carbon\\Laravel\\ServiceProvider',
),
),
'nunomaduro/collision' =>
array (
'providers' =>
array (
0 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
),
),
'nwidart/laravel-modules' =>
array (
'providers' =>
array (
0 => 'Nwidart\\Modules\\LaravelModulesServiceProvider',
),
'aliases' =>
array (
'Module' => 'Nwidart\\Modules\\Facades\\Module',
),
),
'realrashid/sweet-alert' =>
array (
'providers' =>
array (
0 => 'RealRashid\\SweetAlert\\SweetAlertServiceProvider',
),
'aliases' =>
array (
'Alert' => 'RealRashid\\SweetAlert\\Facades\\Alert',
),
),
'theanik/laravel-more-command' =>
array (
'providers' =>
array (
0 => 'Theanik\\LaravelMoreCommand\\LaravelMoreCommandProvider',
),
),
'yajra/laravel-datatables-oracle' =>
array (
'providers' =>
array (
0 => 'Yajra\\DataTables\\DataTablesServiceProvider',
),
'aliases' =>
array (
'DataTables' => 'Yajra\\DataTables\\Facades\\DataTables',
),
),
);

View File

@ -0,0 +1,264 @@
<?php return array (
'providers' =>
array (
0 => 'Illuminate\\Auth\\AuthServiceProvider',
1 => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
2 => 'Illuminate\\Bus\\BusServiceProvider',
3 => 'Illuminate\\Cache\\CacheServiceProvider',
4 => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
5 => 'Illuminate\\Cookie\\CookieServiceProvider',
6 => 'Illuminate\\Database\\DatabaseServiceProvider',
7 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
8 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
9 => 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider',
10 => 'Illuminate\\Hashing\\HashServiceProvider',
11 => 'Illuminate\\Mail\\MailServiceProvider',
12 => 'Illuminate\\Notifications\\NotificationServiceProvider',
13 => 'Illuminate\\Pagination\\PaginationServiceProvider',
14 => 'Illuminate\\Pipeline\\PipelineServiceProvider',
15 => 'Illuminate\\Queue\\QueueServiceProvider',
16 => 'Illuminate\\Redis\\RedisServiceProvider',
17 => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
18 => 'Illuminate\\Session\\SessionServiceProvider',
19 => 'Illuminate\\Translation\\TranslationServiceProvider',
20 => 'Illuminate\\Validation\\ValidationServiceProvider',
21 => 'Illuminate\\View\\ViewServiceProvider',
22 => 'Crabbly\\Fpdf\\FpdfServiceProvider',
23 => 'Darryldecode\\Cart\\CartServiceProvider',
24 => 'Facade\\Ignition\\IgnitionServiceProvider',
25 => 'Fruitcake\\Cors\\CorsServiceProvider',
26 => 'Laravel\\Sail\\SailServiceProvider',
27 => 'Laravel\\Sanctum\\SanctumServiceProvider',
28 => 'Laravel\\Tinker\\TinkerServiceProvider',
29 => 'Collective\\Html\\HtmlServiceProvider',
30 => 'Livewire\\LivewireServiceProvider',
31 => 'MadWeb\\Enum\\EnumServiceProvider',
32 => 'Mews\\Purifier\\PurifierServiceProvider',
33 => 'Carbon\\Laravel\\ServiceProvider',
34 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
35 => 'Nwidart\\Modules\\LaravelModulesServiceProvider',
36 => 'RealRashid\\SweetAlert\\SweetAlertServiceProvider',
37 => 'Theanik\\LaravelMoreCommand\\LaravelMoreCommandProvider',
38 => 'Yajra\\DataTables\\DataTablesServiceProvider',
39 => 'App\\Providers\\AppServiceProvider',
40 => 'App\\Providers\\AuthServiceProvider',
41 => 'App\\Providers\\EventServiceProvider',
42 => 'App\\Providers\\RouteServiceProvider',
43 => 'Collective\\Html\\HtmlServiceProvider',
44 => 'Yajra\\DataTables\\DataTablesServiceProvider',
45 => 'Mews\\Purifier\\PurifierServiceProvider',
46 => 'Darryldecode\\Cart\\CartServiceProvider',
),
'eager' =>
array (
0 => 'Illuminate\\Auth\\AuthServiceProvider',
1 => 'Illuminate\\Cookie\\CookieServiceProvider',
2 => 'Illuminate\\Database\\DatabaseServiceProvider',
3 => 'Illuminate\\Encryption\\EncryptionServiceProvider',
4 => 'Illuminate\\Filesystem\\FilesystemServiceProvider',
5 => 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider',
6 => 'Illuminate\\Notifications\\NotificationServiceProvider',
7 => 'Illuminate\\Pagination\\PaginationServiceProvider',
8 => 'Illuminate\\Session\\SessionServiceProvider',
9 => 'Illuminate\\View\\ViewServiceProvider',
10 => 'Crabbly\\Fpdf\\FpdfServiceProvider',
11 => 'Darryldecode\\Cart\\CartServiceProvider',
12 => 'Facade\\Ignition\\IgnitionServiceProvider',
13 => 'Fruitcake\\Cors\\CorsServiceProvider',
14 => 'Laravel\\Sanctum\\SanctumServiceProvider',
15 => 'Livewire\\LivewireServiceProvider',
16 => 'MadWeb\\Enum\\EnumServiceProvider',
17 => 'Mews\\Purifier\\PurifierServiceProvider',
18 => 'Carbon\\Laravel\\ServiceProvider',
19 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
20 => 'Nwidart\\Modules\\LaravelModulesServiceProvider',
21 => 'RealRashid\\SweetAlert\\SweetAlertServiceProvider',
22 => 'Theanik\\LaravelMoreCommand\\LaravelMoreCommandProvider',
23 => 'Yajra\\DataTables\\DataTablesServiceProvider',
24 => 'App\\Providers\\AppServiceProvider',
25 => 'App\\Providers\\AuthServiceProvider',
26 => 'App\\Providers\\EventServiceProvider',
27 => 'App\\Providers\\RouteServiceProvider',
28 => 'Yajra\\DataTables\\DataTablesServiceProvider',
29 => 'Mews\\Purifier\\PurifierServiceProvider',
30 => 'Darryldecode\\Cart\\CartServiceProvider',
),
'deferred' =>
array (
'Illuminate\\Broadcasting\\BroadcastManager' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
'Illuminate\\Contracts\\Broadcasting\\Factory' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
'Illuminate\\Contracts\\Broadcasting\\Broadcaster' => 'Illuminate\\Broadcasting\\BroadcastServiceProvider',
'Illuminate\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Contracts\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Bus\\BatchRepository' => 'Illuminate\\Bus\\BusServiceProvider',
'cache' => 'Illuminate\\Cache\\CacheServiceProvider',
'cache.store' => 'Illuminate\\Cache\\CacheServiceProvider',
'cache.psr6' => 'Illuminate\\Cache\\CacheServiceProvider',
'memcached.connector' => 'Illuminate\\Cache\\CacheServiceProvider',
'Illuminate\\Cache\\RateLimiter' => 'Illuminate\\Cache\\CacheServiceProvider',
'command.cache.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cache.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.clear-compiled' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.auth.resets.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.config.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.config.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Database\\Console\\DbCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.db.prune' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.db.wipe' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.down' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.environment' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.list' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.key.generate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.optimize' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.optimize.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.package.discover' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.failed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.flush' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.listen' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.monitor' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.prune-batches' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.prune-failed-jobs' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.restart' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.retry' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.retry-batch' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.work' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.list' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.schema.dump' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.seed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleFinishCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleListCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleRunCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleClearCacheCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleTestCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleWorkCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.storage.link' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.up' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.view.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.view.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cache.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cast.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.channel.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.component.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.console.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.controller.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.generate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.exception.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.factory.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.job.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.listener.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.mail.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.middleware.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.model.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.notification.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.notification.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.observer.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.policy.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.provider.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.failed-table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.batches-table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.request.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.resource.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.rule.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.seeder.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.session.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.serve' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.stub.publish' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.test.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.vendor.publish' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'migrator' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'migration.repository' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'migration.creator' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.fresh' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.install' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.refresh' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.reset' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.rollback' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.status' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.migrate.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'composer' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'hash' => 'Illuminate\\Hashing\\HashServiceProvider',
'hash.driver' => 'Illuminate\\Hashing\\HashServiceProvider',
'mail.manager' => 'Illuminate\\Mail\\MailServiceProvider',
'mailer' => 'Illuminate\\Mail\\MailServiceProvider',
'Illuminate\\Mail\\Markdown' => 'Illuminate\\Mail\\MailServiceProvider',
'Illuminate\\Contracts\\Pipeline\\Hub' => 'Illuminate\\Pipeline\\PipelineServiceProvider',
'queue' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.connection' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.failer' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.listener' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.worker' => 'Illuminate\\Queue\\QueueServiceProvider',
'redis' => 'Illuminate\\Redis\\RedisServiceProvider',
'redis.connection' => 'Illuminate\\Redis\\RedisServiceProvider',
'auth.password' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
'auth.password.broker' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
'translator' => 'Illuminate\\Translation\\TranslationServiceProvider',
'translation.loader' => 'Illuminate\\Translation\\TranslationServiceProvider',
'validator' => 'Illuminate\\Validation\\ValidationServiceProvider',
'validation.presence' => 'Illuminate\\Validation\\ValidationServiceProvider',
'Laravel\\Sail\\Console\\InstallCommand' => 'Laravel\\Sail\\SailServiceProvider',
'Laravel\\Sail\\Console\\PublishCommand' => 'Laravel\\Sail\\SailServiceProvider',
'command.tinker' => 'Laravel\\Tinker\\TinkerServiceProvider',
'html' => 'Collective\\Html\\HtmlServiceProvider',
'form' => 'Collective\\Html\\HtmlServiceProvider',
'Collective\\Html\\HtmlBuilder' => 'Collective\\Html\\HtmlServiceProvider',
'Collective\\Html\\FormBuilder' => 'Collective\\Html\\HtmlServiceProvider',
),
'when' =>
array (
'Illuminate\\Broadcasting\\BroadcastServiceProvider' =>
array (
),
'Illuminate\\Bus\\BusServiceProvider' =>
array (
),
'Illuminate\\Cache\\CacheServiceProvider' =>
array (
),
'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider' =>
array (
),
'Illuminate\\Hashing\\HashServiceProvider' =>
array (
),
'Illuminate\\Mail\\MailServiceProvider' =>
array (
),
'Illuminate\\Pipeline\\PipelineServiceProvider' =>
array (
),
'Illuminate\\Queue\\QueueServiceProvider' =>
array (
),
'Illuminate\\Redis\\RedisServiceProvider' =>
array (
),
'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider' =>
array (
),
'Illuminate\\Translation\\TranslationServiceProvider' =>
array (
),
'Illuminate\\Validation\\ValidationServiceProvider' =>
array (
),
'Laravel\\Sail\\SailServiceProvider' =>
array (
),
'Laravel\\Tinker\\TinkerServiceProvider' =>
array (
),
'Collective\\Html\\HtmlServiceProvider' =>
array (
),
),
);

View File

@ -0,0 +1,13 @@
<?php return array (
'providers' =>
array (
0 => 'Modules\\User\\Providers\\UserServiceProvider',
),
'eager' =>
array (
0 => 'Modules\\User\\Providers\\UserServiceProvider',
),
'deferred' =>
array (
),
);

View File

@ -0,0 +1,83 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"aws/aws-sdk-php": "^3.276",
"crabbly/fpdf-laravel": "^1.0",
"darryldecode/cart": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.7",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravelcollective/html": "^6.3",
"league/flysystem-aws-s3-v3": "^1.0",
"livewire/livewire": "^2.0",
"mad-web/laravel-enum": "^2.2",
"mews/purifier": "^3.4",
"nwidart/laravel-modules": "^8.3",
"phpoffice/phpspreadsheet": "^2.0",
"realrashid/sweet-alert": "^7.0",
"spatie/db-dumper": "^3.4",
"spatie/regex": "^1.4",
"swiftmailer/swiftmailer": "^6.3",
"yajra/laravel-datatables-oracle": "^9.21"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10",
"theanik/laravel-more-command": "^1.3"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/Helpers/BackendHelper.php",
"app/Helpers/FrontendHelper.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}

9486
bangunan testing/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,241 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'Asia/Jakarta',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Yajra\DataTables\DataTablesServiceProvider::class,
Mews\Purifier\PurifierServiceProvider::class,
Darryldecode\Cart\CartServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'DataTables' => Yajra\DataTables\Facades\DataTables::class,
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Js' => Illuminate\Support\Js::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Purifier' => Mews\Purifier\Facades\Purifier::class,
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
],
];

View File

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

View File

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

View File

@ -0,0 +1,110 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];

View File

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

View File

@ -0,0 +1,147 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];

View File

@ -0,0 +1,73 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
'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),
],
],
/*
|--------------------------------------------------------------------------
| 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'),
],
];

View File

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

View File

@ -0,0 +1,118 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

View File

@ -0,0 +1,118 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array", "failover"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

View File

@ -0,0 +1,277 @@
<?php
use Nwidart\Modules\Activators\FileActivator;
use Nwidart\Modules\Commands;
return [
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules',
/*
|--------------------------------------------------------------------------
| Module Stubs
|--------------------------------------------------------------------------
|
| Default module stubs.
|
*/
'stubs' => [
'enabled' => false,
'path' => base_path('vendor/nwidart/laravel-modules/src/Commands/stubs'),
'files' => [
'routes/web' => 'Routes/web.php',
'routes/api' => 'Routes/api.php',
'views/index' => 'Resources/views/index.blade.php',
'views/master' => 'Resources/views/layouts/master.blade.php',
'scaffold/config' => 'Config/config.php',
'composer' => 'composer.json',
'assets/js/app' => 'Resources/assets/js/app.js',
'assets/sass/app' => 'Resources/assets/sass/app.scss',
'webpack' => 'webpack.mix.js',
'package' => 'package.json',
],
'replacements' => [
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
'routes/api' => ['LOWER_NAME'],
'webpack' => ['LOWER_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
'composer' => [
'LOWER_NAME',
'STUDLY_NAME',
'VENDOR',
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path used for save the generated module. This path also will be added
| automatically to list of scanned folders.
|
*/
'modules' => base_path('Modules'),
/*
|--------------------------------------------------------------------------
| Modules assets path
|--------------------------------------------------------------------------
|
| Here you may update the modules assets path.
|
*/
'assets' => public_path('modules'),
/*
|--------------------------------------------------------------------------
| The migrations path
|--------------------------------------------------------------------------
|
| Where you run 'module:publish-migration' command, where do you publish the
| the migration files?
|
*/
'migration' => base_path('database/migrations'),
/*
|--------------------------------------------------------------------------
| Generator path
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Set the generate key to false to not generate that folder
*/
'generator' => [
'config' => ['path' => 'Config', 'generate' => true],
'command' => ['path' => 'Console', 'generate' => true],
'migration' => ['path' => 'Database/Migrations', 'generate' => true],
'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
'factory' => ['path' => 'Database/factories', 'generate' => true],
'model' => ['path' => 'Entities', 'generate' => true],
'routes' => ['path' => 'Routes', 'generate' => true],
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'provider' => ['path' => 'Providers', 'generate' => true],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
'test' => ['path' => 'Tests/Unit', 'generate' => true],
'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => false],
'event' => ['path' => 'Events', 'generate' => false],
'listener' => ['path' => 'Listeners', 'generate' => false],
'policies' => ['path' => 'Policies', 'generate' => false],
'rules' => ['path' => 'Rules', 'generate' => false],
'jobs' => ['path' => 'Jobs', 'generate' => false],
'emails' => ['path' => 'Emails', 'generate' => false],
'notifications' => ['path' => 'Notifications', 'generate' => false],
'resource' => ['path' => 'Transformers', 'generate' => false],
'component-view' => ['path' => 'Resources/views/components', 'generate' => false],
'component-class' => ['path' => 'View/Components', 'generate' => false],
],
],
/*
|--------------------------------------------------------------------------
| Package commands
|--------------------------------------------------------------------------
|
| Here you can define which commands will be visible and used in your
| application. If for example you don't use some of the commands provided
| you can simply comment them out.
|
*/
'commands' => [
Commands\CommandMakeCommand::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
Commands\ControllerMakeCommand::class,
Commands\DisableCommand::class,
Commands\DumpCommand::class,
Commands\EnableCommand::class,
Commands\EventMakeCommand::class,
Commands\JobMakeCommand::class,
Commands\ListenerMakeCommand::class,
Commands\MailMakeCommand::class,
Commands\MiddlewareMakeCommand::class,
Commands\NotificationMakeCommand::class,
Commands\ProviderMakeCommand::class,
Commands\RouteProviderMakeCommand::class,
Commands\InstallCommand::class,
Commands\ListCommand::class,
Commands\ModuleDeleteCommand::class,
Commands\ModuleMakeCommand::class,
Commands\FactoryMakeCommand::class,
Commands\PolicyMakeCommand::class,
Commands\RequestMakeCommand::class,
Commands\RuleMakeCommand::class,
Commands\MigrateCommand::class,
Commands\MigrateRefreshCommand::class,
Commands\MigrateResetCommand::class,
Commands\MigrateRollbackCommand::class,
Commands\MigrateStatusCommand::class,
Commands\MigrationMakeCommand::class,
Commands\ModelMakeCommand::class,
Commands\PublishCommand::class,
Commands\PublishConfigurationCommand::class,
Commands\PublishMigrationCommand::class,
Commands\PublishTranslationCommand::class,
Commands\SeedCommand::class,
Commands\SeedMakeCommand::class,
Commands\SetupCommand::class,
Commands\UnUseCommand::class,
Commands\UpdateCommand::class,
Commands\UseCommand::class,
Commands\ResourceMakeCommand::class,
Commands\TestMakeCommand::class,
Commands\LaravelModulesV6Migrator::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
],
/*
|--------------------------------------------------------------------------
| Scan Path
|--------------------------------------------------------------------------
|
| Here you define which folder will be scanned. By default will scan vendor
| directory. This is useful if you host the package in packagist website.
|
*/
'scan' => [
'enabled' => false,
'paths' => [
base_path('vendor/*/*'),
],
],
/*
|--------------------------------------------------------------------------
| Composer File Template
|--------------------------------------------------------------------------
|
| Here is the config for composer.json file, generated by this package
|
*/
'composer' => [
'vendor' => 'nwidart',
'author' => [
'name' => 'Nicolas Widart',
'email' => 'n.widart@gmail.com',
],
'composer-output' => false,
],
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| Here is the config for setting up caching feature.
|
*/
'cache' => [
'enabled' => false,
'key' => 'laravel-modules',
'lifetime' => 60,
],
/*
|--------------------------------------------------------------------------
| Choose what laravel-modules will register as custom namespaces.
| Setting one to false will require you to register that part
| in your own Service Provider class.
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => true,
/**
* load files on boot or register method
*
* Note: boot not compatible with asgardcms
*
* @example boot|register
*/
'files' => 'register',
],
/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],
'activator' => 'file',
];

View File

@ -0,0 +1,106 @@
<?php
/**
* Ok, glad you are here
* first we get a config instance, and set the settings
* $config = HTMLPurifier_Config::createDefault();
* $config->set('Core.Encoding', $this->config->get('purifier.encoding'));
* $config->set('Cache.SerializerPath', $this->config->get('purifier.cachePath'));
* if ( ! $this->config->get('purifier.finalize')) {
* $config->autoFinalize = false;
* }
* $config->loadArray($this->getConfig());
*
* You must NOT delete the default settings
* anything in settings should be compacted with params that needed to instance HTMLPurifier_Config.
*
* @link http://htmlpurifier.org/live/configdoc/plain.html
*/
return [
'encoding' => 'UTF-8',
'finalize' => true,
'ignoreNonStrings' => false,
'cachePath' => storage_path('app/purifier'),
'cacheFileMode' => 0755,
'settings' => [
'default' => [
'HTML.Doctype' => 'HTML 4.01 Transitional',
'HTML.Allowed' => 'div,b,strong,i,em,u,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
'AutoFormat.AutoParagraph' => true,
'AutoFormat.RemoveEmpty' => true,
],
'test' => [
'Attr.EnableID' => 'true',
],
"youtube" => [
"HTML.SafeIframe" => 'true',
"URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
],
'custom_definition' => [
'id' => 'html5-definitions',
'rev' => 1,
'debug' => false,
'elements' => [
// http://developers.whatwg.org/sections.html
['section', 'Block', 'Flow', 'Common'],
['nav', 'Block', 'Flow', 'Common'],
['article', 'Block', 'Flow', 'Common'],
['aside', 'Block', 'Flow', 'Common'],
['header', 'Block', 'Flow', 'Common'],
['footer', 'Block', 'Flow', 'Common'],
// Content model actually excludes several tags, not modelled here
['address', 'Block', 'Flow', 'Common'],
['hgroup', 'Block', 'Required: h1 | h2 | h3 | h4 | h5 | h6', 'Common'],
// http://developers.whatwg.org/grouping-content.html
['figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'],
['figcaption', 'Inline', 'Flow', 'Common'],
// http://developers.whatwg.org/the-video-element.html#the-video-element
['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [
'src' => 'URI',
'type' => 'Text',
'width' => 'Length',
'height' => 'Length',
'poster' => 'URI',
'preload' => 'Enum#auto,metadata,none',
'controls' => 'Bool',
]],
['source', 'Block', 'Flow', 'Common', [
'src' => 'URI',
'type' => 'Text',
]],
// http://developers.whatwg.org/text-level-semantics.html
['s', 'Inline', 'Inline', 'Common'],
['var', 'Inline', 'Inline', 'Common'],
['sub', 'Inline', 'Inline', 'Common'],
['sup', 'Inline', 'Inline', 'Common'],
['mark', 'Inline', 'Inline', 'Common'],
['wbr', 'Inline', 'Empty', 'Core'],
// http://developers.whatwg.org/edits.html
['ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']],
['del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']],
],
'attributes' => [
['iframe', 'allowfullscreen', 'Bool'],
['table', 'height', 'Text'],
['td', 'border', 'Text'],
['th', 'border', 'Text'],
['tr', 'width', 'Text'],
['tr', 'height', 'Text'],
['tr', 'border', 'Text'],
],
],
'custom_attributes' => [
['a', 'target', 'Enum#_blank,_self,_target,_top'],
],
'custom_elements' => [
['u', 'Inline', 'Inline', 'Common'],
],
],
];

View File

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

View File

@ -0,0 +1,65 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. If this value is null, personal access tokens do
| not expire. This won't tweak the lifetime of first-party sessions.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
],
];

View File

@ -0,0 +1,33 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'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'),
],
];

View File

@ -0,0 +1,201 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" since this is a secure default value.
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => 'lax',
];

View File

@ -0,0 +1,36 @@
<?php
return [
/*
* ---------------------------------------------------------------
* formatting
* ---------------------------------------------------------------
*
* the formatting of shopping cart values
*/
'format_numbers' => env('SHOPPING_FORMAT_VALUES', false),
'decimals' => env('SHOPPING_DECIMALS', 0),
'dec_point' => env('SHOPPING_DEC_POINT', '.'),
'thousands_sep' => env('SHOPPING_THOUSANDS_SEP', ','),
/*
* ---------------------------------------------------------------
* persistence
* ---------------------------------------------------------------
*
* the configuration for persisting cart
*/
'storage' => null,
/*
* ---------------------------------------------------------------
* events
* ---------------------------------------------------------------
*
* the configuration for cart events
*/
'events' => null,
];

View File

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

1
bangunan testing/database/.gitignore vendored Normal file
View File

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

View File

@ -0,0 +1,39 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('username')->unique(); // baru
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('level'); // baru
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
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.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebsitesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('websites', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('websites');
}
}

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLogActivitesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('log_activites', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('log_activites');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddKodeTransaksiToTblTransaksiTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('tbl_transaksi', function (Blueprint $table) {
$table->string('kode_transaksi')->after('id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('tbl_transaksi', function (Blueprint $table) {
$table->dropColumn('kode_transaksi');
});
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSuppliersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('suppliers', function (Blueprint $table) {
$table->id();
$table->string('nama_supplier');
$table->string('nama_produk');
$table->integer('jumlah');
$table->decimal('harga', 15, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('suppliers');
}
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPaymentMethodToTblTransaksi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('tbl_transaksi', function (Blueprint $table) {
$table->string('payment_method')->after('total')->default('cash'); // Menambahkan kolom payment_method
});
}
public function down()
{
Schema::table('tbl_transaksi', function (Blueprint $table) {
$table->dropColumn('payment_method');
});
}
}

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