├── Dockerfile
├── database
├── .gitignore
├── seeders
│ ├── MemberSeeder.php
│ ├── SellingSeeder.php
│ ├── ProductSeeder.php
│ ├── CategorySeeder.php
│ ├── DatabaseSeeder.php
│ ├── PaymentMethodSeeder.php
│ ├── RetailSeeder.php
│ └── UserSeeder.php
├── factories
│ ├── TableFactory.php
│ ├── CartItemsFactory.php
│ └── Tenants
│ │ ├── StockFactory.php
│ │ ├── CartItemsFactory.php
│ │ ├── CategoryFactory.php
│ │ ├── MemberFactory.php
│ │ ├── SellingDetailFactory.php
│ │ └── VoucherFactory.php
└── migrations
│ ├── tenant
│ ├── 2024_06_28_121711_add_soft_deletes_to_users_table.php
│ ├── 2024_08_17_144346_rename_debt_to_receivables.php
│ ├── 2024_06_27_094910_add_soft_deletes_to_products_table.php
│ ├── 2024_07_10_101840_add_soft_deletes_to_suppliers_table.php
│ ├── 2024_08_10_141819_create_tables_table.php
│ ├── 2024_06_04_090736_add_expired_to_stocks_table.php
│ ├── 2024_06_28_121250_add_soft_deletes_to_payment_methods_table.php
│ ├── 2024_06_29_081746_alter_date_to_datetime_tz_to_sellings_table.php
│ ├── 2023_12_25_134350_alter_users_table_update_name_to_nullable.php
│ ├── 2024_01_11_004136_create_settings_table.php
│ ├── 2024_06_14_144712_add_status_to_stocks_table.php
│ ├── 2024_07_01_084238_add_show_flag_to_products_table.php
│ ├── 2022_08_05_091039_create_categories_table.php
│ ├── 2024_05_15_072214_create_suppliers_table.php
│ ├── 2024_06_14_083112_add_status_to_purchasings_table.php
│ ├── 2024_07_16_150432_alter_date_to_datetime_in_stock_opnames_table.php
│ ├── 2024_05_14_081316_add_expired_column_to_products_table.php
│ ├── 2024_06_04_082221_drop_expired_columns_in_products_table.php
│ ├── 2024_06_15_061148_add_status_to_stock_opnames_table.php
│ ├── 2024_01_15_020304_add_is_non_stock_column_to_products_table.php
│ ├── 2024_01_22_153445_rename_net_to_cost_in_selling_details_table.php
│ ├── 2024_02_03_020050_add_customer_number_to_sellings_table.php
│ ├── 2024_06_01_150050_add_discount_price_to_selling_details_table.php
│ ├── 2024_01_22_153347_rename_net_to_cost_in_sellings_table.php
│ ├── 2024_06_01_145733_add_discount_price_per_item_to_cart_items_table.php
│ ├── 2024_06_11_035820_alter_discount_price_in_sellings_table.php
│ ├── 2024_05_16_133531_create_stock_opnames_table.php
│ ├── 2024_06_15_132017_add_total_discount_per_item_to_sellings_table.php
│ ├── 2024_06_15_162542_update_stock_default_value_in_stocks_table.php
│ ├── 2024_01_19_004105_create_secure_initial_prices_table.php
│ ├── 2023_11_18_002104_add_expires_at_to_personal_access_token_table.php
│ ├── 2024_06_15_162254_update_stock_default_value_in_products_table.php
│ ├── 2024_06_19_035357_add_default_value_0_to_stocks_table.php
│ ├── 2024_04_25_095957_add_fee_in_sellings_table.php
│ ├── 2024_06_19_040426_add_default_value_0_to_products_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2024_01_11_114938_add_init_stock_to_stocks_table.php
│ ├── 2024_04_22_015613_add_fcm_token_column_to_users_table.php
│ ├── 2024_04_26_020523_add_is_owner_to_users_table.php
│ ├── 2024_04_30_031549_add_timezone_to_profiles_table.php
│ ├── 2023_12_28_000544_add_hero_images_in_products_table.php
│ ├── 2024_04_25_095019_add_note_column_to_sellings_table.php
│ ├── 2024_08_14_142654_add_user_id_to_stock_opnames_table.php
│ ├── 2024_08_17_084148_add_user_id_to_purchasings_table.php
│ ├── 2024_05_01_134019_add_paid_status_to_sellings_table.php
│ ├── 2024_01_17_152124_add_total_net_price_to_sellings_table.php
│ ├── 2024_02_10_124657_create_printers_table.php
│ ├── 2024_01_16_120400_add_sku_to_products_table.php
│ ├── 2024_01_17_152330_add_net_price_to_sellings_details_table.php
│ ├── 2024_04_29_052554_create_notifications_table.php
│ ├── 2024_04_27_064744_add_other_business_type_column_to_abouts_table.php
│ ├── 2024_08_14_223500_add_column_to_stock_opnames_table.php
│ ├── 2024_05_01_154201_create_cart_items_table.php
│ ├── 2024_05_15_073335_add_purchasing_id_to_stocks_table.php
│ ├── 2022_11_01_000001_create_features_table.php
│ ├── 2024_08_11_003435_add_table_id_to_sellings_table.php
│ ├── 2024_01_22_151911_add_user_id_to_sellings_table.php
│ ├── 2024_05_17_082634_create_debt_items_table.php
│ ├── 2024_01_16_130626_create_cash_drawers_table.php
│ ├── 2022_08_07_072341_create_members_table.php
│ ├── 2024_04_30_071721_create_sessions_table.php
│ ├── 2024_01_17_080158_add_cash_drawer_to_sellings_table.php
│ ├── 2022_08_07_081309_create_selling_details_table.php
│ ├── 2024_01_28_234657_add_tax_prices_in_sellings_table.php
│ ├── 2024_05_28_032821_add_voucher_to_sellings_table.php
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2024_08_10_012257_create_jobs_table.php
│ ├── 2024_08_14_150920_rename_column_in_stock_opname_items_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2022_10_01_040456_create_product_images_table.php
│ ├── 2023_12_25_043227_create_profiles_table.php
│ ├── 2024_05_17_233746_create_debt_payments_table.php
│ ├── 2024_08_16_152218_add_approved_at_column_to_purchasings_table.php
│ ├── 2024_05_28_011245_create_vouchers_table.php
│ └── 2024_08_19_131747_add_payment_method_id_to_purchasings_table.php
│ ├── 2024_04_25_234446_drop_abouts_table.php
│ ├── 2023_12_25_121929_alter_tenant_users_table_update_the_full_name_column.php
│ ├── 2024_01_11_010006_drop_currency_in_abouts_table.php
│ ├── 2023_12_19_132441_create_admins_table.php
│ ├── 2019_09_15_000010_create_tenants_table.php
│ ├── 2024_08_10_012803_create_jobs_table.php
│ └── 2019_09_15_000020_create_domains_table.php
├── resources
├── views
│ ├── .gitkeep
│ ├── filament
│ │ ├── forms
│ │ │ └── product
│ │ │ │ └── files.blade.php
│ │ └── tenant
│ │ │ ├── pages
│ │ │ ├── kustom.blade.php
│ │ │ ├── edit-profile.blade.php
│ │ │ ├── permission.blade.php
│ │ │ ├── tenant-login.blade.php
│ │ │ ├── general-setting.blade.php
│ │ │ └── about.blade.php
│ │ │ └── resources
│ │ │ └── sellings
│ │ │ └── headers
│ │ │ └── overview.blade.php
│ ├── errors
│ │ ├── 404.blade.php
│ │ ├── 401.blade.php
│ │ ├── 419.blade.php
│ │ ├── 500.blade.php
│ │ ├── 402.blade.php
│ │ ├── 429.blade.php
│ │ ├── 503.blade.php
│ │ └── 403.blade.php
│ ├── components
│ │ ├── table-header.blade.php
│ │ ├── table-row.blade.php
│ │ ├── table-cell.blade.php
│ │ ├── table.blade.php
│ │ ├── table-header-cell.blade.php
│ │ └── layouts
│ │ │ └── app.blade.php
│ ├── livewire
│ │ └── forms
│ │ │ ├── global
│ │ │ ├── timezone-select.blade.php
│ │ │ └── localization-selector.blade.php
│ │ │ └── auth
│ │ │ └── register.blade.php
│ └── forms
│ │ └── components
│ │ └── image-preview.blade.php
└── css
│ ├── filament
│ └── tenant
│ │ ├── tailwind.config.js
│ │ └── theme.css
│ └── app.css
├── bootstrap
└── cache
│ └── .gitignore
├── storage
├── logs
│ └── .gitignore
├── app
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── public
├── robots.txt
├── favicon.ico
├── assets
│ ├── logo
│ │ └── image.png
│ └── images
│ │ ├── member.png
│ │ ├── dashboard.png
│ │ ├── stock-management.png
│ │ ├── calculator-payment.png
│ │ ├── cashier-transaction.png
│ │ ├── product-management.png
│ │ ├── cashier-transaction-1.jpg
│ │ ├── cashier-transaction-1.png
│ │ ├── dashboard-transaction.png
│ │ └── payment-methods
│ │ └── cash.png
└── .htaccess
├── readme
├── .DS_Store
└── Screenshot
│ ├── .DS_Store
│ ├── cashier-menu.png
│ └── product-detail.png
├── tests
├── Unit
│ └── ExampleTest.php
├── TestCase.php
├── CreatesApplication.php
├── Feature
│ └── Http
│ │ └── Controllers
│ │ ├── Api
│ │ └── Tenants
│ │ │ └── Master
│ │ │ └── ProductControllerTest.php
│ │ └── Auth
│ │ └── AuthenticatedSessionControllerTest.php
└── RefreshDatabaseWithTenant.php
├── lang
├── id
│ ├── pagination.php
│ ├── auth.php
│ ├── notifications.php
│ └── password.php
└── en
│ ├── notifications.php
│ ├── pagination.php
│ ├── auth.php
│ └── passwords.php
├── .gitattributes
├── postcss.config.js
├── app
├── Constants
│ ├── VoucherType.php
│ ├── Role.php
│ ├── ConstantInterface.php
│ ├── PurchasingStatus.php
│ └── StockOpnameStatus.php
├── Features
│ ├── Role.php
│ ├── User.php
│ ├── Member.php
│ ├── Voucher.php
│ ├── Supplier.php
│ ├── Permission.php
│ ├── Purchasing.php
│ ├── Receivable.php
│ ├── SellingTax.php
│ ├── StockOpname.php
│ ├── PaymentMethod.php
│ ├── ProductSku.php
│ ├── ProductType.php
│ ├── ProductStock.php
│ ├── PrintSellingA5.php
│ ├── ProductBarcode.php
│ ├── ProductExpired.php
│ ├── PrintProductLabel.php
│ ├── ProductInitialPrice.php
│ ├── PaymentShortcutButton.php
│ └── TotalRevenueInSellingTable.php
├── Observers
│ ├── TenantObserver.php
│ ├── UserObserver.php
│ ├── StockOpnameObserver.php
│ ├── MemberObserver.php
│ └── AbstractObserver.php
├── Forms
│ └── Components
│ │ └── ImagePreview.php
├── Filament
│ └── Tenant
│ │ ├── Resources
│ │ ├── Traits
│ │ │ ├── RedirectToIndex.php
│ │ │ ├── RefreshThePage.php
│ │ │ └── HasItemData.php
│ │ ├── RoleResource
│ │ │ └── Pages
│ │ │ │ ├── CreateRole.php
│ │ │ │ ├── EditRole.php
│ │ │ │ └── ListRoles.php
│ │ ├── ReceivableResource
│ │ │ └── Pages
│ │ │ │ ├── CreateReceivable.php
│ │ │ │ ├── EditReceivable.php
│ │ │ │ └── ListReceivables.php
│ │ ├── SupplierResource
│ │ │ └── Pages
│ │ │ │ ├── CreateSupplier.php
│ │ │ │ ├── EditSupplier.php
│ │ │ │ └── ListSuppliers.php
│ │ ├── TableResource
│ │ │ └── Pages
│ │ │ │ ├── CreateTable.php
│ │ │ │ ├── ListTables.php
│ │ │ │ └── EditTable.php
│ │ ├── VoucherResource
│ │ │ └── Pages
│ │ │ │ ├── CreateVoucher.php
│ │ │ │ ├── ListVouchers.php
│ │ │ │ └── EditVoucher.php
│ │ ├── UserResource
│ │ │ └── Pages
│ │ │ │ ├── CreateUser.php
│ │ │ │ └── ListUsers.php
│ │ ├── MemberResource
│ │ │ └── Pages
│ │ │ │ ├── CreateMember.php
│ │ │ │ ├── EditMember.php
│ │ │ │ └── ListMembers.php
│ │ ├── CategoryResource
│ │ │ └── Pages
│ │ │ │ ├── CreateCategory.php
│ │ │ │ ├── ListCategories.php
│ │ │ │ └── EditCategory.php
│ │ ├── PaymentMethodResource
│ │ │ └── Pages
│ │ │ │ ├── CreatePaymentMethod.php
│ │ │ │ ├── ListPaymentMethods.php
│ │ │ │ └── EditPaymentMethod.php
│ │ ├── ProductResource
│ │ │ └── Pages
│ │ │ │ └── ListProducts.php
│ │ ├── PurchasingResource
│ │ │ ├── Pages
│ │ │ │ └── ListPurchasings.php
│ │ │ └── Widgets
│ │ │ │ └── PurchaseOverview.php
│ │ └── StockOpnameResource
│ │ │ ├── Pages
│ │ │ └── ListStockOpnames.php
│ │ │ └── Widgets
│ │ │ └── StockOpnameOverview.php
│ │ └── Widgets
│ │ └── ExpiredProduct.php
├── Models
│ └── Tenants
│ │ ├── Cart.php
│ │ ├── Notification.php
│ │ ├── Printer.php
│ │ ├── Voucher.php
│ │ ├── Member.php
│ │ ├── Category.php
│ │ ├── Supplier.php
│ │ ├── Table.php
│ │ ├── SecureInitialPrice.php
│ │ ├── ReceivableItem.php
│ │ ├── StockOpnameItem.php
│ │ ├── ProductImage.php
│ │ ├── StockOpname.php
│ │ ├── ReceivablePayment.php
│ │ ├── Profile.php
│ │ ├── SellingDetail.php
│ │ ├── Purchasing.php
│ │ ├── PaymentMethod.php
│ │ ├── CashDrawer.php
│ │ └── Receivable.php
├── Http
│ ├── Resources
│ │ ├── CategoryCollection.php
│ │ ├── NotificationCollection.php
│ │ ├── StockCollection.php
│ │ └── ProductCollection.php
│ ├── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── VerifyCsrfToken.php
│ │ ├── PreventRequestsDuringMaintenance.php
│ │ ├── TrustHosts.php
│ │ ├── TrimStrings.php
│ │ ├── Authenticate.php
│ │ ├── TrustProxies.php
│ │ ├── EnsureEmailIsVerified.php
│ │ ├── LocalizationMiddleware.php
│ │ └── RedirectIfAuthenticated.php
│ └── Controllers
│ │ ├── Api
│ │ └── Tenants
│ │ │ ├── Reports
│ │ │ └── SellingReportController.php
│ │ │ ├── RegisterFCMTokenController.php
│ │ │ └── PaymentMethodController.php
│ │ └── Auth
│ │ ├── RegisteredUserController.php
│ │ └── EmailVerificationNotificationController.php
├── Enums
│ └── ShopType.php
├── Console
│ ├── Commands
│ │ ├── MigrateDatabase.php
│ │ ├── RecalculateAllProduct.php
│ │ ├── RefreshPermission.php
│ │ ├── MigrateTestingDatabase.php
│ │ ├── UpdateAllStockToIsReady.php
│ │ ├── FillTheUserIdInSellingWithOwnerUserId.php
│ │ ├── DeleteTempFile.php
│ │ └── FillIsOwnerToUsers.php
│ └── Kernel.php
├── MyBootstrapper.php
├── Services
│ └── Tenants
│ │ ├── StockOpnameItemService.php
│ │ └── Traits
│ │ └── HasNumber.php
├── Events
│ ├── SellingCreated.php
│ └── RecalculateEvent.php
├── Providers
│ ├── BroadcastServiceProvider.php
│ └── VoltServiceProvider.php
├── Listeners
│ ├── CreateReceivableIfCredit.php
│ └── AdjustProduct.php
├── Traits
│ ├── Suppliers
│ │ ├── HasSupplierTable.php
│ │ └── HasSupplierForm.php
│ └── UseTimezoneAwareQuery.php
├── Policies
│ └── Tenants
│ │ └── PermissionPolicy.php
├── View
│ └── Components
│ │ ├── TableRow.php
│ │ ├── TableCell.php
│ │ ├── TableHeader.php
│ │ ├── Table.php
│ │ └── TableHeaderCell.php
└── TenantUser.php
├── .styleci.yml
├── routes
├── console.php
├── web.php
├── api.php
└── channels.php
├── config
└── setting.php
├── .lando.yml
├── .gitignore
├── package.json
├── vite.config.js
├── laradumps.yaml
├── .editorconfig
├── tailwind.config.js
└── .github
└── FUNDING.yml
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Dockerfile
2 |
3 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/resources/views/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/readme/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/readme/.DS_Store
--------------------------------------------------------------------------------
/resources/views/filament/forms/product/files.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/assets/logo/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/logo/image.png
--------------------------------------------------------------------------------
/readme/Screenshot/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/readme/Screenshot/.DS_Store
--------------------------------------------------------------------------------
/public/assets/images/member.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/member.png
--------------------------------------------------------------------------------
/public/assets/images/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/dashboard.png
--------------------------------------------------------------------------------
/readme/Screenshot/cashier-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/readme/Screenshot/cashier-menu.png
--------------------------------------------------------------------------------
/readme/Screenshot/product-detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/readme/Screenshot/product-detail.png
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/kustom.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/tests/Unit/ExampleTest.php:
--------------------------------------------------------------------------------
1 | toBeTrue();
5 | });
6 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/edit-profile.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/permission.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/tenant-login.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/public/assets/images/stock-management.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/stock-management.png
--------------------------------------------------------------------------------
/public/assets/images/calculator-payment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/calculator-payment.png
--------------------------------------------------------------------------------
/public/assets/images/cashier-transaction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/cashier-transaction.png
--------------------------------------------------------------------------------
/public/assets/images/product-management.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/product-management.png
--------------------------------------------------------------------------------
/lang/id/pagination.php:
--------------------------------------------------------------------------------
1 | '« Sebelumnya',
5 | 'next' => 'Berikutnya »',
6 | ];
7 |
--------------------------------------------------------------------------------
/public/assets/images/cashier-transaction-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/cashier-transaction-1.jpg
--------------------------------------------------------------------------------
/public/assets/images/cashier-transaction-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/cashier-transaction-1.png
--------------------------------------------------------------------------------
/public/assets/images/dashboard-transaction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/dashboard-transaction.png
--------------------------------------------------------------------------------
/public/assets/images/payment-methods/cash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/is2024/lakasir/HEAD/public/assets/images/payment-methods/cash.png
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/resources/views/errors/404.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Not Found'))
4 | @section('code', '404')
5 | @section('message', __('Not Found'))
6 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | 'tailwindcss/nesting': 'postcss-nesting',
4 | tailwindcss: {},
5 | autoprefixer: {},
6 | },
7 | }
8 |
--------------------------------------------------------------------------------
/resources/views/components/table-header.blade.php:
--------------------------------------------------------------------------------
1 | merge(['class' => 'bg-gray-50 dark:bg-gray-700']) }}>
2 |
3 | {{ $slot }}
4 |
5 |
6 |
--------------------------------------------------------------------------------
/resources/views/errors/401.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Unauthorized'))
4 | @section('code', '401')
5 | @section('message', __('Unauthorized'))
6 |
--------------------------------------------------------------------------------
/resources/views/errors/419.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Page Expired'))
4 | @section('code', '419')
5 | @section('message', __('Page Expired'))
6 |
--------------------------------------------------------------------------------
/resources/views/errors/500.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Server Error'))
4 | @section('code', '500')
5 | @section('message', __('Server Error'))
6 |
--------------------------------------------------------------------------------
/resources/views/components/table-row.blade.php:
--------------------------------------------------------------------------------
1 | merge(['class' => isset($loop) ? $loop->odd ? 'bg-gray-50 dark:bg-gray-700' : '' : '' ]) }}>
2 | {{ $slot }}
3 |
4 |
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | compiled.php
2 | config.php
3 | down
4 | events.scanned.php
5 | maintenance.php
6 | routes.php
7 | routes.scanned.php
8 | schedule-*
9 | services.json
10 |
--------------------------------------------------------------------------------
/resources/views/components/table-cell.blade.php:
--------------------------------------------------------------------------------
1 | merge(['class' => 'px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300']) }}>
2 | {{ $slot }}
3 | |
4 |
--------------------------------------------------------------------------------
/resources/views/errors/402.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Payment Required'))
4 | @section('code', '402')
5 | @section('message', __('Payment Required'))
6 |
--------------------------------------------------------------------------------
/resources/views/errors/429.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Too Many Requests'))
4 | @section('code', '429')
5 | @section('message', __('Too Many Requests'))
6 |
--------------------------------------------------------------------------------
/resources/views/errors/503.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Service Unavailable'))
4 | @section('code', '503')
5 | @section('message', __('Service Unavailable'))
6 |
--------------------------------------------------------------------------------
/resources/views/components/table.blade.php:
--------------------------------------------------------------------------------
1 | merge(['class' => 'min-w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700']) }}>
2 | {{ $slot }}
3 |
4 |
--------------------------------------------------------------------------------
/resources/views/errors/403.blade.php:
--------------------------------------------------------------------------------
1 | @extends('errors::layout')
2 |
3 | @section('title', __('Forbidden'))
4 | @section('code', '403')
5 | @section('message', __($exception->getMessage() ?: 'Forbidden'))
6 |
--------------------------------------------------------------------------------
/resources/views/livewire/forms/global/timezone-select.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lang/id/auth.php:
--------------------------------------------------------------------------------
1 | 'Identitas tersebut tidak cocok dengan data kami.',
5 | 'throttle' => 'Terlalu banyak usaha masuk. Silahkan coba lagi dalam :seconds detik.',
6 | ];
7 |
--------------------------------------------------------------------------------
/resources/views/livewire/forms/global/localization-selector.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/Constants/VoucherType.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
8 | })->purpose('Display an inspiring quote');
9 |
--------------------------------------------------------------------------------
/app/Features/ProductType.php:
--------------------------------------------------------------------------------
1 | merge(['class' => 'px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider']) }}>
2 | {{ $slot }}
3 |
4 |
--------------------------------------------------------------------------------
/app/Constants/PurchasingStatus.php:
--------------------------------------------------------------------------------
1 | getResource()::getNavigationUrl();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Cart.php:
--------------------------------------------------------------------------------
1 | [
5 | 'currency',
6 | 'selling_method',
7 | 'cash_drawer_enabled',
8 | 'secure_initial_price_enabled',
9 | 'secure_initial_price_using_pin',
10 | 'default_tax',
11 | 'minimum_stock_nofication',
12 | ],
13 | ];
14 |
--------------------------------------------------------------------------------
/app/Enums/ShopType.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
14 |
15 | return $app;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/general-setting.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ $this->form }}
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/RoleResource/Pages/CreateRole.php:
--------------------------------------------------------------------------------
1 | create();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/database/seeders/SellingSeeder.php:
--------------------------------------------------------------------------------
1 | user()->associate(auth()->user());
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/SupplierResource/Pages/CreateSupplier.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/Traits/RefreshThePage.php:
--------------------------------------------------------------------------------
1 | dispatch('refreshExampleRelationManager');
10 | }
11 |
12 | public function getListeners()
13 | {
14 | return ['refreshExampleRelationManager' => '$refresh'];
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lang/id/notifications.php:
--------------------------------------------------------------------------------
1 | [
7 | 'single-runs-out' => 'Stok :product mau habis',
8 | 'single-out-of-stock' => 'Stok :product sudah habis',
9 | 'multiple-runs-out' => 'Ada :count produk yang mau habis',
10 | 'field_stock' => 'Stok tinggal :stock',
11 | 'title' => 'Stokmu mau habis!',
12 | ],
13 | ];
14 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | name('auth.register');
11 |
12 | Route::middleware([
13 | 'web',
14 | ])
15 | ->prefix('admin')
16 | ->group(function () {
17 | //
18 | });
19 |
--------------------------------------------------------------------------------
/resources/css/filament/tenant/tailwind.config.js:
--------------------------------------------------------------------------------
1 | import preset from '../../../../vendor/filament/filament/tailwind.config.preset'
2 |
3 | export default {
4 | presets: [preset],
5 | content: [
6 | './vendor/awcodes/filament-table-repeater/resources/**/*.blade.php',
7 | './app/Filament/Tenant/**/*.php',
8 | './resources/views/filament/tenant/**/*.blade.php',
9 | './vendor/filament/**/*.blade.php',
10 | ],
11 | }
12 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/Tenants/Reports/SellingReportController.php:
--------------------------------------------------------------------------------
1 | 'domain'], function ()
7 | {
8 | Route::post('/register', RegisteredUserController::class)
9 | ->name('register');
10 | });
11 |
12 | Route::get('/test', function ()
13 | {
14 | return response()->json([
15 | 'message' => 'Success!',
16 | ]);
17 | });
18 |
19 |
--------------------------------------------------------------------------------
/app/Services/Tenants/StockOpnameItemService.php:
--------------------------------------------------------------------------------
1 | fill($data);
12 | $soi->save();
13 | }
14 |
15 | public function updateStatus(StockOpnameItem $soi, string $status)
16 | {
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Console/Commands/RecalculateAllProduct.php:
--------------------------------------------------------------------------------
1 | 'PermissionSeeder',
16 | ]);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lang/id/password.php:
--------------------------------------------------------------------------------
1 | 'Kata sandi harus minimal enam karakter dan cocok dengan konfirmasi.',
5 | 'reset' => 'Kata sandi Anda sudah di atur ulang!',
6 | 'sent' => 'Kami sudah mengirim email yang berisi tautan untuk mengatur ulang kata sandi Anda!',
7 | 'token' => 'Kata sandi token pengaturan ulang tidak sah.',
8 | 'user' => 'Kami tidak dapat menemukan pengguna dengan alamat surel tersebut.',
9 | ];
10 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/TableResource/Pages/CreateTable.php:
--------------------------------------------------------------------------------
1 | [
7 | 'single-runs-out' => 'Stock for :product will runs out',
8 | 'single-out-of-stock' => 'Stock for :product out of stock',
9 | 'multiple-runs-out' => 'There is :count products that will runs of out of stock',
10 | 'field_stock' => 'The rest stock is :stock',
11 | 'title' => 'Your stock will runs out',
12 | ],
13 | ];
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /public/tmp
5 | /storage/*.key
6 | /storage/debugbar
7 | /vendor
8 | /public/js/
9 | /public/css/
10 | /public/app/
11 | /nginx/*.log
12 | /packages
13 | /public/build/manifest.json
14 | public/build
15 | tags
16 | .env
17 | .env.backup
18 | .phpunit.result.cache
19 | Homestead.json
20 | Homestead.yaml
21 | npm-debug.log
22 | yarn-error.log
23 | tinker.php
24 | _ide_helper.php
25 | .phpunit.cache/test-results
26 |
--------------------------------------------------------------------------------
/app/Events/SellingCreated.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | // 'localhost:3000/*',
16 | 'livewire/*',
17 | ];
18 | }
19 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/resources/sellings/headers/overview.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | use App\Features\TotalRevenueInSellingTable;
3 | use App\Models\Tenants\Setting;
4 | @endphp
5 | @feature(TotalRevenueInSellingTable::class)
6 |
7 |
@lang('Total revenue')
8 |
{{ Number::currency(10000, Setting::get('currency', 'IDR')) }}
9 |
10 | @endfeature
11 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/VoucherResource/Pages/CreateVoucher.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts()
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/MemberResource/Pages/CreateMember.php:
--------------------------------------------------------------------------------
1 | postJson('/api/master/product', [])
14 | ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);
15 | });
16 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/CategoryResource/Pages/CreateCategory.php:
--------------------------------------------------------------------------------
1 | format('Ymd');
10 |
11 | $countForToday = ($this->model::whereDate('created_at', today())->latest()->first()?->id ?? 0);
12 | $sequentialNumber = str_pad($countForToday + 1, $length, '0', STR_PAD_LEFT);
13 |
14 | return $prefix.'-'.$date.$sequentialNumber;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/Http/Resources/NotificationCollection.php:
--------------------------------------------------------------------------------
1 | $this->id,
14 | 'type' => $this->type,
15 | 'data' => $this->data,
16 | 'created_at' => $this->created_at,
17 | ];
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Member.php:
--------------------------------------------------------------------------------
1 | hasMany(Receivable::class);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/resources/views/filament/tenant/pages/about.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | {{ $this->form }}
8 |
9 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/Tenants/RegisterFCMTokenController.php:
--------------------------------------------------------------------------------
1 | id());
14 | $user->fill($request->all());
15 | $user->save();
16 |
17 | return $this->success([]);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Category.php:
--------------------------------------------------------------------------------
1 | hasMany(Product::class, 'category_id');
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Supplier.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class TableFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition(): array
18 | {
19 | return [
20 | //
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/seeders/ProductSeeder.php:
--------------------------------------------------------------------------------
1 | create();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/PaymentMethodResource/Pages/CreatePaymentMethod.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
 }})
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/TableResource/Pages/ListTables.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class CartItemsFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition(): array
18 | {
19 | return [
20 | //
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/factories/Tenants/StockFactory.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class StockFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition(): array
18 | {
19 | return [
20 | //
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/Tenants/PaymentMethodController.php:
--------------------------------------------------------------------------------
1 | buildResponse()
15 | ->setData($paymentMethods)
16 | ->setMessage('success get payment methods')
17 | ->present();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/SupplierResource/Pages/EditSupplier.php:
--------------------------------------------------------------------------------
1 | selling->paymentMethod->is_credit) {
17 | $this->receivableService->create($event->selling, $event->data);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/database/factories/Tenants/CartItemsFactory.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class CartItemsFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition(): array
18 | {
19 | return [
20 | //
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/CategoryResource/Pages/ListCategories.php:
--------------------------------------------------------------------------------
1 | translateLabel(),
14 | TextColumn::make('phone_number')
15 | ->translateLabel(),
16 | ];
17 | }
18 |
19 | public static function columns(): array
20 | {
21 | return (new self)->getColumns();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/seeders/CategorySeeder.php:
--------------------------------------------------------------------------------
1 | "UMUM"
22 | ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/Feature/Http/Controllers/Auth/AuthenticatedSessionControllerTest.php:
--------------------------------------------------------------------------------
1 | $user->email,
15 | 'password' => 'password',
16 | ]);
17 |
18 | $response->assertOk()
19 | ->assertSee('token');
20 | });
21 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Table.php:
--------------------------------------------------------------------------------
1 | hasMany(Selling::class);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Policies/Tenants/PermissionPolicy.php:
--------------------------------------------------------------------------------
1 | can('read permission');
13 | }
14 |
15 | public function view(User $user, Permission $permission): bool
16 | {
17 | return $user->can('read permission');
18 | }
19 |
20 | public function create(User $user): bool
21 | {
22 | return false;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/database/factories/Tenants/CategoryFactory.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class CategoryFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition(): array
18 | {
19 | return [
20 | 'name' => $this->faker->name,
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/resources/views/forms/components/image-preview.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | @lang('Empty')
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/View/Components/TableRow.php:
--------------------------------------------------------------------------------
1 | $products
17 | * @return void
18 | */
19 | public function __construct(public $products, public array $data)
20 | {
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/View/Components/Table.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Providers/VoltServiceProvider.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/TableResource/Pages/EditTable.php:
--------------------------------------------------------------------------------
1 | command(DeleteTempFile::class)->daily();
15 | $schedule->command(FCM::class)->daily();
16 | }
17 |
18 | protected function commands()
19 | {
20 | $this->load(__DIR__.'/Commands');
21 |
22 | require base_path('routes/console.php');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/MemberResource/Pages/EditMember.php:
--------------------------------------------------------------------------------
1 | call(UserSeeder::class);
17 | $this->call(CategorySeeder::class);
18 | $this->call(ProductSeeder::class);
19 | $this->call(SellingSeeder::class);
20 | $this->call(PermissionSeeder::class);
21 | $this->call(PaymentMethodSeeder::class);
22 | // \App\Models\User::factory(10)->create();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/MemberResource/Pages/ListMembers.php:
--------------------------------------------------------------------------------
1 | belongsTo(Receivable::class);
21 | }
22 |
23 | public function product(): BelongsTo
24 | {
25 | return $this->belongsTo(Product::class);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Console/Commands/MigrateTestingDatabase.php:
--------------------------------------------------------------------------------
1 | belongsTo(StockOpname::class);
21 | }
22 |
23 | public function product(): BelongsTo
24 | {
25 | return $this->belongsTo(Product::class);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/CategoryResource/Pages/EditCategory.php:
--------------------------------------------------------------------------------
1 | callHook('beforeFill');
13 | $record->load($this->loads());
14 |
15 | $data = $this->mutateFormDataBeforeFill([
16 | ...$record->toArray(),
17 | ...$extraData,
18 | ]);
19 |
20 | $this->form->fill($data);
21 |
22 | $this->callHook('afterFill');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/Tenants/ProductImage.php:
--------------------------------------------------------------------------------
1 | belongsTo(Product::class);
21 | }
22 |
23 | public function getPathAttribute()
24 | {
25 | $value = $this->attributes['name'];
26 |
27 | return Storage::disk('public')->path($value);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/PaymentMethodResource/Pages/EditPaymentMethod.php:
--------------------------------------------------------------------------------
1 | translateLabel()
14 | ->required(),
15 | TextInput::make('phone_number')
16 | ->translateLabel()
17 | ->rule('regex:/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}$/')
18 | ->required(),
19 | ];
20 | }
21 |
22 | public static function form(): array
23 | {
24 | return (new self)->getForm();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Models/Tenants/StockOpname.php:
--------------------------------------------------------------------------------
1 | hasMany(StockOpnameItem::class);
22 | }
23 |
24 | public function user(): BelongsTo
25 | {
26 | return $this->belongsTo(User::class);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Observers/MemberObserver.php:
--------------------------------------------------------------------------------
1 | count();
13 | $lastMember = Member::orderBy('code', 'desc')->first();
14 | if ($lastMember) {
15 | $lastCount = (int) substr($lastMember->code, 3);
16 | } else {
17 | $lastCount = 0;
18 | }
19 |
20 | if (! $member->code) {
21 | // Generate the new customer code
22 | $member->code = 'CUS'.str_pad($lastCount + 1, 4, '0', STR_PAD_LEFT);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/database/factories/Tenants/MemberFactory.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class MemberFactory extends Factory
11 | {
12 | /**
13 | * Define the model's default state.
14 | *
15 | * @return array
16 | */
17 | public function definition()
18 | {
19 | return [
20 | 'name' => $this->faker->name,
21 | 'code' => "CUS0001",
22 | 'address' => $this->faker->streetAddress,
23 | 'email' => $this->faker->email
24 | ];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisteredUserController.php:
--------------------------------------------------------------------------------
1 | register();
13 | if ($tenant) {
14 | return response()->json([
15 | 'success' => true,
16 | 'message' => 'Success!',
17 | 'data' => $tenant,
18 | ]);
19 | }
20 |
21 | return response()->json([
22 | 'success' => false,
23 | 'message' => 'Failed!',
24 | ]);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Observers/AbstractObserver.php:
--------------------------------------------------------------------------------
1 | all()['components'])) {
19 | $data = Arr::undot(request()->all()['components'][0]['updates'])['data'] ?? [];
20 | $this->setData($data);
21 | } else {
22 | $this->setData(request()->all());
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'password' => 'The provided password is incorrect.',
18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
19 |
20 | ];
21 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_28_121711_add_soft_deletes_to_users_table.php:
--------------------------------------------------------------------------------
1 | softDeletes();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('users', function (Blueprint $table) {
25 | $table->dropSoftDeletes();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Console/Commands/UpdateAllStockToIsReady.php:
--------------------------------------------------------------------------------
1 | update(['is_ready' => true]);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/2024_04_25_234446_drop_abouts_table.php:
--------------------------------------------------------------------------------
1 | rename('receivables');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('receivables', function (Blueprint $table) {
25 | $table->rename('debts');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_27_094910_add_soft_deletes_to_products_table.php:
--------------------------------------------------------------------------------
1 | softDeletes();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->dropSoftDeletes();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_07_10_101840_add_soft_deletes_to_suppliers_table.php:
--------------------------------------------------------------------------------
1 | softDeletes();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('suppliers', function (Blueprint $table) {
25 | $table->dropSoftDeletes();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/factories/Tenants/SellingDetailFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class SellingDetailFactory extends Factory
12 | {
13 | /**
14 | * The name of the factory's corresponding model.
15 | *
16 | * @var string
17 | */
18 | protected $model = SellingDetail::class;
19 | /**
20 | * Define the model's default state.
21 | *
22 | * @return array
23 | */
24 | public function definition()
25 | {
26 | return [
27 | //
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_10_141819_create_tables_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('number');
17 | $table->softDeletes();
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::dropIfExists('tables');
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_04_090736_add_expired_to_stocks_table.php:
--------------------------------------------------------------------------------
1 | date('expired')->nullable()->after('date');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stocks', function (Blueprint $table) {
25 | $table->dropColumn('expired');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_28_121250_add_soft_deletes_to_payment_methods_table.php:
--------------------------------------------------------------------------------
1 | softDeletes();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('payment_methods', function (Blueprint $table) {
25 | $table->dropSoftDeletes();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Traits/UseTimezoneAwareQuery.php:
--------------------------------------------------------------------------------
1 | user()->profile?->timezone;
17 | $startDate = Carbon::parse($start)->setTimezone($timezone);
18 | $endDate = Carbon::parse($end)->setTimezone($timezone);
19 | dd($startDate, $endDate);
20 |
21 | return $builder->whereBetween($column, [$startDate, $endDate]);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_29_081746_alter_date_to_datetime_tz_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | dateTimeTz('date')->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('sellings', function (Blueprint $table) {
25 | $table->date('date')->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2023_12_25_134350_alter_users_table_update_name_to_nullable.php:
--------------------------------------------------------------------------------
1 | string('name')->nullable()->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('users', function (Blueprint $table) {
25 | $table->string('name')->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_11_004136_create_settings_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('key')->unique();
17 | $table->text('value')->nullable();
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::dropIfExists('settings');
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_14_144712_add_status_to_stocks_table.php:
--------------------------------------------------------------------------------
1 | boolean('is_ready')->default(0)->after('purchasing_id');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stocks', function (Blueprint $table) {
25 | $table->dropColumn('is_ready');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_07_01_084238_add_show_flag_to_products_table.php:
--------------------------------------------------------------------------------
1 | boolean('show')->default(true)->after('hero_images');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->dropColumn('show');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2022_08_05_091039_create_categories_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('categories');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_15_072214_create_suppliers_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('phone_number')->nullable();
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::dropIfExists('suppliers');
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_14_083112_add_status_to_purchasings_table.php:
--------------------------------------------------------------------------------
1 | string('status')->default('pending')->after('tax');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('purchasings', function (Blueprint $table) {
25 | $table->dropColumn('status');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_07_16_150432_alter_date_to_datetime_in_stock_opnames_table.php:
--------------------------------------------------------------------------------
1 | dateTimeTz('date')->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stock_opnames', function (Blueprint $table) {
25 | $table->date('date')->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/ReceivableResource/Pages/ListReceivables.php:
--------------------------------------------------------------------------------
1 | belongsTo(Receivable::class);
21 | }
22 |
23 | public function user(): BelongsTo
24 | {
25 | return $this->belongsTo(User::class);
26 | }
27 |
28 | public function paymentMethod(): BelongsTo
29 | {
30 | return $this->belongsTo(PaymentMethod::class);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_14_081316_add_expired_column_to_products_table.php:
--------------------------------------------------------------------------------
1 | dateTime('expired')->nullable()->after('hero_images');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->dropColumn('expired');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_04_082221_drop_expired_columns_in_products_table.php:
--------------------------------------------------------------------------------
1 | dropColumn('expired');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->dateTime('expired')->nullable()->after('hero_images');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_15_061148_add_status_to_stock_opnames_table.php:
--------------------------------------------------------------------------------
1 | string('status')->default('pending')->after('id');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stock_opnames', function (Blueprint $table) {
25 | $table->dropColumn('status');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/PurchasingResource/Pages/ListPurchasings.php:
--------------------------------------------------------------------------------
1 | each(function (Selling $selling) {
24 | $user = User::first();
25 | $selling->user()->associate($user);
26 | $selling->save();
27 | });
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Profile.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
27 | }
28 |
29 | public static function get(array $key = ['*']): Profile
30 | {
31 | return Profile::select($key)->whereUserId(auth()->id())->first() ?? new Profile();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2023_12_25_121929_alter_tenant_users_table_update_the_full_name_column.php:
--------------------------------------------------------------------------------
1 | string('full_name')->nullable()->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('tenant_users', function (Blueprint $table) {
25 | $table->string('full_name')->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_15_020304_add_is_non_stock_column_to_products_table.php:
--------------------------------------------------------------------------------
1 | boolean('is_non_stock')->default(false)->after('stock');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->dropColumn('is_non_stock');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_22_153445_rename_net_to_cost_in_selling_details_table.php:
--------------------------------------------------------------------------------
1 | renameColumn('net_price', 'cost');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('selling_details', function (Blueprint $table) {
25 | $table->renameColumn('cost', 'net_price');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_02_03_020050_add_customer_number_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | string('customer_number')->nullable()->after('member_id');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('sellings', function (Blueprint $table) {
25 | $table->dropColumn('customer_number');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_01_150050_add_discount_price_to_selling_details_table.php:
--------------------------------------------------------------------------------
1 | double('discount_price')->default(0);
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('selling_details', function (Blueprint $table) {
25 | $table->dropColumn('discount_price');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/StockOpnameResource/Pages/ListStockOpnames.php:
--------------------------------------------------------------------------------
1 | belongsTo(Selling::class);
21 | }
22 |
23 | public function product()
24 | {
25 | return $this->belongsTo(Product::class);
26 | }
27 |
28 | public function totalPrice(): Attribute
29 | {
30 | return Attribute::make(
31 | get: fn () => $this->price - $this->discount_price,
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_22_153347_rename_net_to_cost_in_sellings_table.php:
--------------------------------------------------------------------------------
1 | renameColumn('total_net_price', 'total_cost');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('sellings', function (Blueprint $table) {
25 | $table->renameColumn('total_cost', 'total_net_price');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_01_145733_add_discount_price_per_item_to_cart_items_table.php:
--------------------------------------------------------------------------------
1 | double('discount_price')->default(0)->after('price');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('cart_items', function (Blueprint $table) {
25 | $table->dropColumn('discount_price');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_11_035820_alter_discount_price_in_sellings_table.php:
--------------------------------------------------------------------------------
1 | double('discount_price')->default(0)->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('sellings', function (Blueprint $table) {
25 | $table->double('discount_price')->default(null)->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_16_133531_create_stock_opnames_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('number');
17 | $table->string('pic');
18 | $table->date('date');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | */
26 | public function down(): void
27 | {
28 | Schema::dropIfExists('stock_opnames');
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/seeders/PaymentMethodSeeder.php:
--------------------------------------------------------------------------------
1 | data() as $data) {
15 | \App\Models\Tenants\PaymentMethod::create($data);
16 | }
17 | }
18 |
19 | private function data(): array
20 | {
21 | return [
22 | [
23 | 'name' => 'Cash',
24 | 'is_cash' => true,
25 | 'is_debit' => false,
26 | 'is_credit' => false,
27 | 'is_wallet' => false,
28 | 'icon' => 'assets/images/payment-methods/cash.png',
29 | ],
30 | ];
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have emailed your password reset link!',
18 | 'throttled' => 'Please wait before retrying.',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that email address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/app/Console/Commands/DeleteTempFile.php:
--------------------------------------------------------------------------------
1 | files();
31 | // foreach ($files as $file) {
32 | // Storage::disk('tmp')->delete($file);
33 | // }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Purchasing.php:
--------------------------------------------------------------------------------
1 | hasMany(Stock::class);
22 | }
23 |
24 | public function supplier(): BelongsTo
25 | {
26 | return $this->belongsTo(Supplier::class);
27 | }
28 |
29 | public function paymentMethod(): BelongsTo
30 | {
31 | return $this->belongsTo(PaymentMethod::class);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_15_132017_add_total_discount_per_item_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | double('total_discount_per_item')->default(0)->after('total_cost');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('sellings', function (Blueprint $table) {
25 | $table->dropColumn('total_discount_per_item');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_15_162542_update_stock_default_value_in_stocks_table.php:
--------------------------------------------------------------------------------
1 | double('stock')->nullable(false)->default(0)->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stocks', function (Blueprint $table) {
25 | $table->double('stock')->nullable(true)->default(null)->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/app/Http/Resources/StockCollection.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | public function toArray(Request $request): array
16 | {
17 | return [
18 | 'id' => $this->id,
19 | 'product' => $this->product->name,
20 | 'stock' => $this->stock,
21 | 'init_stock' => $this->init_stock,
22 | 'initial_price' => $this->initial_price,
23 | 'selling_price' => $this->selling_price,
24 | 'type' => $this->type,
25 | 'date' => $this->date,
26 | ];
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Models/Tenants/PaymentMethod.php:
--------------------------------------------------------------------------------
1 | 'boolean',
21 | 'is_debit' => 'boolean',
22 | 'is_credit' => 'boolean',
23 | 'is_wallet' => 'boolean',
24 | ];
25 |
26 | public function icon(): Attribute
27 | {
28 | return Attribute::make(
29 | get: fn ($value) => config('app.url').'/'.$value,
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_19_004105_create_secure_initial_prices_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('user_id')->constrained('users');
17 | $table->string('password');
18 | $table->timestamps();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::dropIfExists('secure_initial_prices');
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/laradumps.yaml:
--------------------------------------------------------------------------------
1 | app:
2 | primary_host: 127.0.0.1
3 | secondary_host: host.docker.internal
4 | port: 9191
5 | workdir: /var/www/html/
6 | project_path: /Users/sheenazien8/Documents/Code/laksir_project/lakasir/
7 | wsl_config: wsl+Ubuntu/
8 | config:
9 | sleep: 0
10 | observers:
11 | auto_invoke_app: false
12 | enabled_in_testing: false
13 | dump: false
14 | original_dump: true
15 | queries: false
16 | slow_queries: false
17 | mail: false
18 | logs: false
19 | http: false
20 | jobs: false
21 | commands: false
22 | scheduled_commands: false
23 | gate: false
24 | logs:
25 | info: false
26 | warning: false
27 | emergency: false
28 | alert: false
29 | debug: false
30 | error: true
31 | critical: true
32 | notice: true
33 | vendor: false
34 | deprecated_message: false
35 | slow_queries:
36 | threshold_in_ms: 500
37 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2023_11_18_002104_add_expires_at_to_personal_access_token_table.php:
--------------------------------------------------------------------------------
1 | timestamp('expires_at')->nullable()->after('last_used_at');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('personal_access_tokens', function (Blueprint $table) {
25 | $table->dropColumn('expires_at');
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_15_162254_update_stock_default_value_in_products_table.php:
--------------------------------------------------------------------------------
1 | double('stock')->nullable(false)->default(0)->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->double('stock')->nullable(true)->default(null)->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_19_035357_add_default_value_0_to_stocks_table.php:
--------------------------------------------------------------------------------
1 | double('initial_price')->nullable(false)->default(0)->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stocks', function (Blueprint $table) {
25 | $table->double('initial_price')->nullable(true)->default(null)->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_25_095957_add_fee_in_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('note', function (Blueprint $table) {
16 | $table->double('fee')->default(0);
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropColumn('fee');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_06_19_040426_add_default_value_0_to_products_table.php:
--------------------------------------------------------------------------------
1 | double('initial_price')->nullable(false)->default(0)->change();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('products', function (Blueprint $table) {
25 | $table->double('initial_price')->nullable(true)->default(null)->change();
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/2024_01_11_010006_drop_currency_in_abouts_table.php:
--------------------------------------------------------------------------------
1 | dropColumn('currency');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('abouts', function (Blueprint $table) {
25 | $table->after('shop_location', function ($table) {
26 | $table->string('currency')->default('IDR');
27 | });
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_11_114938_add_init_stock_to_stocks_table.php:
--------------------------------------------------------------------------------
1 | after('stock', function ($table) {
16 | $table->double('init_stock')->default(0);
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('stocks', function (Blueprint $table) {
27 | $table->dropColumn('init_stock');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/resources/views/components/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ config('app.name') }}
11 |
12 |
17 |
18 | @filamentStyles
19 | @vite('resources/css/app.css')
20 |
21 |
22 |
23 | {{ $slot }}
24 |
25 | @filamentScripts
26 | @vite('resources/js/app.js')
27 |
28 |
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_22_015613_add_fcm_token_column_to_users_table.php:
--------------------------------------------------------------------------------
1 | after('id', function (Blueprint $table) {
16 | $table->string('fcm_token')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('users', function (Blueprint $table) {
27 | $table->dropColumn('fcm_token');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_26_020523_add_is_owner_to_users_table.php:
--------------------------------------------------------------------------------
1 | after('fcm_token', function (Blueprint $table) {
16 | $table->boolean('is_owner')->default(false);
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('users', function (Blueprint $table) {
27 | $table->dropColumn('is_owner');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_30_031549_add_timezone_to_profiles_table.php:
--------------------------------------------------------------------------------
1 | after('locale', function (Blueprint $table) {
16 | $table->string('timezone')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('profiles', function (Blueprint $table) {
27 | $table->dropColumn('timezone');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | ; This file is for unifying the coding style for different editors and IDEs.
2 | ; More information at http://editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | charset = utf-8
8 | indent_style = space
9 | end_of_line = lf
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
15 |
16 | [**.js]
17 | indent_size = 2
18 | indent_style = space
19 |
20 | [**.css]
21 | indent_size = 2
22 | indent_style = space
23 |
24 | [**.scss]
25 | indent_size = 2
26 | indent_style = space
27 |
28 | [**.php]
29 | indent_size = 4
30 | indent_style = space
31 |
32 | [**.blade.php]
33 | indent_style = space
34 | indent_size = 2
35 |
36 | [**.vue]
37 | indent_style = space
38 | indent_size = 2
39 |
40 | [*.vue]
41 | indent_style = space
42 | indent_size = 2
43 |
44 | [**.json]
45 | indent_style = space
46 | indent_size = 4
47 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2023_12_28_000544_add_hero_images_in_products_table.php:
--------------------------------------------------------------------------------
1 | after('type', function (Blueprint $table) {
16 | $table->text('hero_images')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('products', function (Blueprint $table) {
27 | $table->dropColumn('hero_images');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_25_095019_add_note_column_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('cash_drawer_id', function (Blueprint $table) {
16 | $table->text('note')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropColumn('note');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_14_142654_add_user_id_to_stock_opnames_table.php:
--------------------------------------------------------------------------------
1 | after('id', fn () => $table->foreignId('user_id')->constrained());
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stock_opnames', function (Blueprint $table) {
25 | $table->dropForeign(['user_id']);
26 | $table->dropColumn('user_id');
27 | });
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_17_084148_add_user_id_to_purchasings_table.php:
--------------------------------------------------------------------------------
1 | foreignId('user_id')->nullable()->after('supplier_id')->constrained();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('purchasings', function (Blueprint $table) {
25 | $table->dropForeign(['user_id']);
26 | $table->dropColumn('user_id');
27 | });
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | import defaultTheme from "tailwindcss/defaultTheme";
2 | import preset from './vendor/filament/support/tailwind.config.preset'
3 |
4 | import forms from "@tailwindcss/forms";
5 |
6 | /** @type {import('tailwindcss').Config} */
7 | export default {
8 | presets: [preset],
9 | content: [
10 | "./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php",
11 | "./storage/framework/views/*.php",
12 | "./resources/views/**/*.blade.php",
13 | './resources/views/filament/**/*.blade.php',
14 | './app/Filament/**/*.php',
15 | ],
16 |
17 | theme: {
18 | extend: {
19 | fontFamily: {
20 | sans: ["Figtree", ...defaultTheme.fontFamily.sans],
21 | },
22 | colors: {
23 | lakasir: {
24 | primary: "#FF6600",
25 | }
26 | },
27 | },
28 | },
29 |
30 | plugins: [forms],
31 | };
32 |
--------------------------------------------------------------------------------
/database/factories/Tenants/VoucherFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class VoucherFactory extends Factory
12 | {
13 | /**
14 | * Define the model's default state.
15 | *
16 | * @return array
17 | */
18 | public function definition(): array
19 | {
20 | return [
21 | 'name' => 'voucher-1',
22 | 'code' => '000000',
23 | 'type' => VoucherType::flat,
24 | 'nominal' => 2000,
25 | 'minimal_buying' => 20000,
26 | 'start_date' => now(),
27 | 'expired' => now()->addDays(10),
28 | 'kuota' => 20,
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_01_134019_add_paid_status_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('total_qty', function (Blueprint $table) {
16 | $table->boolean('is_paid')->default(true);
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropColumn('is_paid');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_17_152124_add_total_net_price_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('total_price', function ($table) {
16 | $table->double('total_net_price')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropColumn('total_net_price');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_02_10_124657_create_printers_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('driver');
18 | $table->string('port')->nullable();
19 | $table->string('ip_address')->nullable();
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('printers');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_16_120400_add_sku_to_products_table.php:
--------------------------------------------------------------------------------
1 | string("sku")->nullable()->after("name");
16 | $table->string("barcode")->nullable()->after("sku");
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | */
23 | public function down(): void
24 | {
25 | Schema::table('products', function (Blueprint $table) {
26 | $table->dropColumn("sku");
27 | $table->dropColumn("barcode");
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_17_152330_add_net_price_to_sellings_details_table.php:
--------------------------------------------------------------------------------
1 | after('price', function (Blueprint $table) {
16 | $table->double('net_price')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('selling_details', function (Blueprint $table) {
27 | $table->dropColumn('net_price');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/tests/RefreshDatabaseWithTenant.php:
--------------------------------------------------------------------------------
1 | initializeTenant();
21 |
22 | $this->parentBeginDatabaseTransaction();
23 | }
24 |
25 | public function initializeTenant()
26 | {
27 | $tenant = mockTenant();
28 |
29 | tenancy()->initialize($tenant);
30 |
31 | URL::forceRootUrl("http://{$tenant->domains[0]->domain}");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/EmailVerificationNotificationController.php:
--------------------------------------------------------------------------------
1 | user()->hasVerifiedEmail()) {
20 | return redirect()->intended(RouteServiceProvider::HOME);
21 | }
22 |
23 | $request->user()->sendEmailVerificationNotification();
24 |
25 | return response()->json(['status' => 'verification-link-sent']);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_29_052554_create_notifications_table.php:
--------------------------------------------------------------------------------
1 | uuid('id')->primary();
16 | $table->string('type');
17 | $table->morphs('notifiable');
18 | $table->text('data');
19 | $table->timestamp('read_at')->nullable();
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('notifications');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EnsureEmailIsVerified.php:
--------------------------------------------------------------------------------
1 | user() ||
21 | ($request->user() instanceof MustVerifyEmail &&
22 | ! $request->user()->hasVerifiedEmail())) {
23 | return response()->json(['message' => 'Your email address is not verified.'], 409);
24 | }
25 |
26 | return $next($request);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_27_064744_add_other_business_type_column_to_abouts_table.php:
--------------------------------------------------------------------------------
1 | after('business_type', function (Blueprint $table) {
16 | $table->string('other_business_type')->nullable();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('abouts', function (Blueprint $table) {
27 | $table->dropColumn('other_business_type');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_14_223500_add_column_to_stock_opnames_table.php:
--------------------------------------------------------------------------------
1 | date('date')->change();
16 | $table->dateTime('approved_at')->nullable()->after('date');
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | */
23 | public function down(): void
24 | {
25 | Schema::table('stock_opnames', function (Blueprint $table) {
26 | $table->dateTime('date')->change();
27 | $table->dropColumn('approved_at');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_01_154201_create_cart_items_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('user_id')->constrained();
17 | $table->foreignId('product_id')->constrained();
18 | $table->double('qty');
19 | $table->double('price')->nullable();
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('cart_items');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_15_073335_add_purchasing_id_to_stocks_table.php:
--------------------------------------------------------------------------------
1 | foreignId('purchasing_id')->after('product_id')->nullable()->constrained()->cascadeOnDelete()->cascadeOnUpdate();
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('stocks', function (Blueprint $table) {
25 | $table->dropForeign(['purchasing_id']);
26 | $table->dropColumn('purchasing_id');
27 | });
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/resources/css/filament/tenant/theme.css:
--------------------------------------------------------------------------------
1 | @import '/vendor/filament/filament/resources/css/theme.css';
2 | @config '../../../../tailwind.config.js';
3 |
4 |
5 | .fi-sidebar-nav {
6 | @apply bg-white drop-shadow-md dark:bg-gray-900;
7 | }
8 |
9 | .fi-sidebar-item a {
10 | @apply py-2.5 px-2;
11 | }
12 |
13 | .fi-sidebar-item.fi-sidebar-item-active a {
14 | @apply bg-lakasir-primary;
15 | }
16 |
17 | .fi-sidebar-item.fi-sidebar-item-active a:hover {
18 | @apply bg-lakasir-primary;
19 | }
20 |
21 | .fi-sidebar-item.fi-sidebar-item-active svg {
22 | @apply text-white;
23 | }
24 |
25 | .fi-sidebar-item:not(.fi-sidebar-item-active):hover a {
26 | .fi-sidebar-item-label {
27 | @apply text-white;
28 | }
29 |
30 | svg {
31 | @apply text-white;
32 | }
33 |
34 | @apply bg-lakasir-primary text-white;
35 | }
36 |
37 | .fi-sidebar-item-active .fi-sidebar-item-label {
38 | @apply text-white dark:text-white;
39 | }
40 |
--------------------------------------------------------------------------------
/app/Models/Tenants/CashDrawer.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class, 'opened_by');
21 | }
22 |
23 | public function closedBy(): BelongsTo
24 | {
25 | return $this->belongsTo(User::class, 'closed_by');
26 | }
27 |
28 | public function scopeToday()
29 | {
30 | return $this->whereDate('created_at', now());
31 | }
32 |
33 | public function scopeLastOpened()
34 | {
35 | return $this->whereNull('closed_by')->latest();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/PurchasingResource/Widgets/PurchaseOverview.php:
--------------------------------------------------------------------------------
1 | count();
15 | $reviewing = Purchasing::whereStatus(PurchasingStatus::reviewing)->count();
16 | $pending = Purchasing::whereStatus(PurchasingStatus::pending)->count();
17 |
18 | return [
19 | Stat::make(__('Approved'), $approved),
20 | Stat::make(__('Reviewing'), $reviewing),
21 | Stat::make(__('Pending'), $pending),
22 | ];
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/database/migrations/2023_12_19_132441_create_admins_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('email')->unique();
18 | $table->timestamp('email_verified_at')->nullable();
19 | $table->string('password');
20 | $table->rememberToken();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('admins');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_09_15_000010_create_tenants_table.php:
--------------------------------------------------------------------------------
1 | string('id')->primary();
20 |
21 | // your custom columns may go here
22 |
23 | $table->timestamps();
24 | $table->json('data')->nullable();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down(): void
34 | {
35 | Schema::dropIfExists('tenants');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2022_11_01_000001_create_features_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('scope');
20 | $table->text('value');
21 | $table->timestamps();
22 |
23 | $table->unique(['name', 'scope']);
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('features');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/app/TenantUser.php:
--------------------------------------------------------------------------------
1 | $notifications
11 | * @property-read int|null $notifications_count
12 | * @method static \Illuminate\Database\Eloquent\Builder|TenantUser newModelQuery()
13 | * @method static \Illuminate\Database\Eloquent\Builder|TenantUser newQuery()
14 | * @method static \Illuminate\Database\Eloquent\Builder|TenantUser query()
15 | * @mixin \Eloquent
16 | * @mixin IdeHelperTenantUser
17 | */
18 | class TenantUser extends Model
19 | {
20 | use HasFactory, Notifiable;
21 |
22 | protected $fillable = [
23 | 'tenant_id',
24 | 'full_name',
25 | 'email',
26 | 'password',
27 | ];
28 | }
29 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Resources/StockOpnameResource/Widgets/StockOpnameOverview.php:
--------------------------------------------------------------------------------
1 | count();
15 | $reviewing = StockOpname::whereStatus(StockOpnameStatus::reviewing)->count();
16 | $pending = StockOpname::whereStatus(StockOpnameStatus::pending)->count();
17 |
18 | return [
19 | Stat::make(__('Approved'), $approved),
20 | Stat::make(__('Reviewing'), $reviewing),
21 | Stat::make(__('Pending'), $pending),
22 | ];
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Http/Middleware/LocalizationMiddleware.php:
--------------------------------------------------------------------------------
1 | user();
24 | if ($user) {
25 | $locale = $user->profile->locale ?? 'en';
26 | }
27 | config(['app.locale' => $locale]);
28 | app()->setLocale($locale);
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Listeners/AdjustProduct.php:
--------------------------------------------------------------------------------
1 | products;
17 | if ($products->count() > 0) {
18 | $products->each(function (Product $product) {
19 | // dd($product->stock_calculate, $product->initial_price_calculate, $product->selling_price_calculate);
20 | $product->stock = $product->stock_calculate;
21 | $product->initial_price = $product->initial_price_calculate ?? $product->initial_price;
22 | $product->selling_price = $product->selling_price_calculate ?? $product->selling_price;
23 | $product->save();
24 | });
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_11_003435_add_table_id_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('member_id', function (Blueprint $table) {
16 | $table->foreignId('table_id')->nullable()->constrained();
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropForeign(['table_id']);
28 | $table->dropColumn('table_id');
29 | });
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/seeders/RetailSeeder.php:
--------------------------------------------------------------------------------
1 | call(CategorySeeder::class, true);
18 | Stock::truncate();
19 | Product::truncate();
20 |
21 | $path = 'database/seeders/retail_product.sql';
22 | if (file_exists($path)) {
23 | DB::unprepared(file_get_contents($path));
24 | $this->command->info('Retail product seeded!');
25 |
26 | return;
27 | }
28 | $contactEmail = 'lakasirapp@gmail.com';
29 | $this->command->warn("Contact the Lakasir owner to get this retail product: mailto://$contactEmail");
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_22_151911_add_user_id_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('id', function ($table) {
16 | $table->foreignId('user_id')->nullable()->constrained('users')->onDelete('cascade');
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropForeign(['user_id']);
28 | $table->dropColumn('user_id');
29 | });
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_17_082634_create_debt_items_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('product_id')->constrained();
17 | $table->foreignId('debt_id')->constrained();
18 | $table->double('amount');
19 | $table->double('price');
20 | $table->double('subtotal');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('debt_items');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_16_130626_create_cash_drawers_table.php:
--------------------------------------------------------------------------------
1 | id();
17 | $table->foreignId('opened_by')->constrained('users', 'id');
18 | $table->foreignId('closed_by')->nullable()->constrained('users', 'id');
19 | $table->double('cash')->default(0);
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('cash_drawers');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2022_08_07_072341_create_members_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('code')->unique();
20 | $table->string('address')->nullable();
21 | $table->string('email')->nullable()->unique();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('members');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_04_30_071721_create_sessions_table.php:
--------------------------------------------------------------------------------
1 | string('id')->primary();
16 | $table->foreignId('user_id')->nullable()->index();
17 | $table->string('ip_address', 45)->nullable();
18 | $table->text('user_agent')->nullable();
19 | $table->longText('payload');
20 | $table->integer('last_activity')->index();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('sessions');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_17_080158_add_cash_drawer_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('member_id', function ($table) {
16 | $table->foreignId('cash_drawer_id')->nullable()->constrained('cash_drawers');
17 | });
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('sellings', function (Blueprint $table) {
27 | $table->dropForeign(['cash_drawer_id']);
28 | $table->dropColumn('cash_drawer_id');
29 | });
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
25 | return redirect(RouteServiceProvider::HOME);
26 | }
27 | }
28 |
29 | return $next($request);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Models/Tenants/Receivable.php:
--------------------------------------------------------------------------------
1 | belongsTo(Member::class);
22 | }
23 |
24 | public function selling(): BelongsTo
25 | {
26 | return $this->belongsTo(Selling::class);
27 | }
28 |
29 | public function receivableItems(): HasMany
30 | {
31 | return $this->hasMany(ReceivableItem::class);
32 | }
33 |
34 | public function receivablePayments(): HasMany
35 | {
36 | return $this->hasMany(ReceivablePayment::class);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Console/Commands/FillIsOwnerToUsers.php:
--------------------------------------------------------------------------------
1 | table('tenant_users')
25 | ->select('email')
26 | ->where('tenant_id', tenant()->id)
27 | ->first();
28 | if ($tenantUser) {
29 | User::query()
30 | ->where('email', $tenantUser->email)
31 | ->update([
32 | 'is_owner' => true,
33 | ]);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2022_08_07_081309_create_selling_details_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('selling_id')->constrained();
19 | $table->foreignId('product_id')->constrained();
20 | $table->double('price');
21 | $table->double('qty');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('selling_details');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_01_28_234657_add_tax_prices_in_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('total_price', function (Blueprint $table) {
16 | // TODO: delete this in future, and update all of double to decimal like this
17 | $table->decimal('tax_price', 15, 2)->default(0);
18 | });
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::table('sellings', function (Blueprint $table) {
28 | $table->dropColumn('tax_price');
29 | });
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_28_032821_add_voucher_to_sellings_table.php:
--------------------------------------------------------------------------------
1 | after('fee', function (Blueprint $table) {
16 | $table->string('voucher')->nullable();
17 | $table->double('discount_price')->nullable();
18 | });
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | */
25 | public function down(): void
26 | {
27 | Schema::table('sellings', function (Blueprint $table) {
28 | $table->dropColumn('voucher');
29 | $table->dropColumn('discount_price');
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/seeders/UserSeeder.php:
--------------------------------------------------------------------------------
1 | getDatabaseName();
25 | $tenant = Tenant::find(Str::after($dbName, 'lakasir_')) ?? tenant();
26 | $email = $tenant->user->email;
27 | $password = $tenant->user->password;
28 | }
29 | User::create([
30 | 'email' => $email,
31 | 'password' => $password,
32 | ]);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Resources/ProductCollection.php:
--------------------------------------------------------------------------------
1 | $this->id,
13 | 'name' => $this->name,
14 | 'category' => $this->category,
15 | 'category_id' => $this->category->id,
16 | 'initial_price' => $this->initial_price,
17 | 'selling_price' => $this->selling_price,
18 | 'type' => $this->type,
19 | 'unit' => $this->unit,
20 | 'stock' => $this->stock,
21 | 'is_non_stock' => (bool) $this->is_non_stock,
22 | 'hero_images' => $this->hero_images,
23 | 'sku' => $this->sku,
24 | 'barcode' => $this->barcode,
25 | 'show' => $this->show,
26 | 'stocks' => $this->whenLoaded('stocks'),
27 | ];
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->rememberToken();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_10_012257_create_jobs_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
16 | $table->string('queue')->index();
17 | $table->longText('payload');
18 | $table->unsignedTinyInteger('attempts');
19 | $table->unsignedInteger('reserved_at')->nullable();
20 | $table->unsignedInteger('available_at');
21 | $table->unsignedInteger('created_at');
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('jobs');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_14_150920_rename_column_in_stock_opname_items_table.php:
--------------------------------------------------------------------------------
1 | renameColumn('amount', 'actual_stock');
16 | $table->renameColumn('amount_after_adjustment', 'missing_stock');
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | */
23 | public function down(): void
24 | {
25 | Schema::table('stock_opname_items', function (Blueprint $table) {
26 | $table->renameColumn('actual_stock', 'amount');
27 | $table->renameColumn('missing_stock', 'amount_after_adjustment');
28 | });
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('uuid')->unique();
19 | $table->text('connection');
20 | $table->text('queue');
21 | $table->longText('payload');
22 | $table->longText('exception');
23 | $table->timestamp('failed_at')->useCurrent();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('failed_jobs');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2022_10_01_040456_create_product_images_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignId('product_id')->constrained()->cascadeOnDelete();
19 | $table->string('name');
20 | $table->string('url');
21 | $table->string('size');
22 | $table->string('type');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('product_images');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/app/Filament/Tenant/Widgets/ExpiredProduct.php:
--------------------------------------------------------------------------------
1 | query(
16 | Product::nearestExpiredProduct()
17 | )
18 | ->columns([
19 | TextColumn::make('name')
20 | ->translateLabel(),
21 | TextColumn::make('expired')
22 | ->getStateUsing(fn (Product $product) => $product->expired_stock?->expired)
23 | ->date()
24 | ->translateLabel(),
25 | ])
26 | ->recordUrl(function (Product $product) {
27 | return '/member/products/'.$product->getKey().'/edit';
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [lakasir] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12 | polar: # Replace with a single Polar username
13 | buy_me_a_coffee: sheenazien8 # Replace with a single Buy Me a Coffee username
14 | thanks_dev: # Replace with a single thanks.dev username
15 | custom: ["https://trakteer.id/sheenazien8/tip"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
16 |
--------------------------------------------------------------------------------
/database/migrations/2024_08_10_012803_create_jobs_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
17 | $table->string('queue')->index();
18 | $table->longText('payload');
19 | $table->unsignedTinyInteger('attempts');
20 | $table->unsignedInteger('reserved_at')->nullable();
21 | $table->unsignedInteger('available_at');
22 | $table->unsignedInteger('created_at');
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('jobs');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2023_12_25_043227_create_profiles_table.php:
--------------------------------------------------------------------------------
1 | id();
17 | $table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
18 | $table->string('phone')->nullable();
19 | $table->string('photo')->nullable();
20 | $table->string('address')->nullable();
21 | $table->string('locale')->nullable();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('profiles');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_17_233746_create_debt_payments_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('user_id')->constrained();
17 | $table->foreignId('payment_method_id')->constrained();
18 | $table->foreignId('debt_id')->constrained();
19 | $table->double('amount');
20 | $table->double('last_debt');
21 | $table->date('date');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('debt_payments');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_16_152218_add_approved_at_column_to_purchasings_table.php:
--------------------------------------------------------------------------------
1 | date('date')->change();
16 | $table->date('due_date')->change();
17 | $table->dateTime('approved_at')->nullable()->after('due_date');
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::table('purchasings', function (Blueprint $table) {
27 | $table->dateTime('date')->change();
28 | $table->dateTime('due_date')->change();
29 | $table->dropColumn('approved_at');
30 | });
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_05_28_011245_create_vouchers_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('code');
18 | $table->string('type');
19 | $table->double('nominal');
20 | $table->integer('kuota');
21 | $table->date('start_date');
22 | $table->date('expired');
23 | $table->double('minimal_buying');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | */
31 | public function down(): void
32 | {
33 | Schema::dropIfExists('vouchers');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/database/migrations/2019_09_15_000020_create_domains_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
20 | $table->string('domain', 255)->unique();
21 | $table->string('tenant_id');
22 |
23 | $table->timestamps();
24 | $table->foreign('tenant_id')->references('id')->on('tenants')->onUpdate('cascade')->onDelete('cascade');
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down(): void
34 | {
35 | Schema::dropIfExists('domains');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/tenant/2024_08_19_131747_add_payment_method_id_to_purchasings_table.php:
--------------------------------------------------------------------------------
1 | foreignId('payment_method_id')->after('id')->nullable()->constrained();
16 | $table->boolean('payment_status')->after('status')->default(false);
17 | });
18 | }
19 |
20 | /**
21 | * Reverse the migrations.
22 | */
23 | public function down(): void
24 | {
25 | Schema::table('purchasings', function (Blueprint $table) {
26 | $table->dropForeign(['payment_method_id']);
27 | $table->dropColumn('payment_method_id');
28 | $table->dropColumn('payment_status');
29 | });
30 | }
31 | };
32 |
--------------------------------------------------------------------------------