├── public ├── favicon.ico ├── js │ └── filament │ │ ├── tables │ │ ├── tables.js │ │ └── components │ │ │ └── table.js │ │ └── forms │ │ ├── components │ │ ├── textarea.js │ │ ├── tags-input.js │ │ └── key-value.js │ │ └── forms.js ├── robots.txt ├── brands │ ├── dinero-logo.png │ ├── dinero-favicon.png │ ├── dinero-logo-adm.png │ └── dinero-logo-white.png ├── css │ ├── awcodes │ │ └── filament-badgeable-column │ │ │ └── filament-badgeable-column.css │ └── filament │ │ └── support │ │ └── support.css ├── .htaccess └── index.php ├── docker ├── config │ └── nginx.conf ├── app │ ├── php.ini │ ├── entrypoint.sh │ └── supervisor.conf └── nginx │ └── default.conf ├── database ├── .gitignore ├── seeders │ ├── UserSeeder.php │ ├── DatabaseSeeder.php │ ├── AccountSeeder.php │ ├── DebtSeeder.php │ ├── GoalSeeder.php │ ├── WalletSeeder.php │ └── CategorySeeder.php ├── migrations │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ ├── 2023_07_25_164549_create_notifications_table.php │ ├── 2023_07_25_173733_create_account_manager_invitations_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2015_07_25_170745_create_accounts_table.php │ ├── 2023_07_25_171709_account_member_table.php │ ├── 2023_07_31_173915_create_budget_category_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2023_07_31_182107_create_goals_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2023_07_25_155250_create_breezy_tables.php │ ├── 2023_07_31_183330_create_debts_table.php │ ├── 2015_07_27_225207_create_categories_table.php │ ├── 2023_07_31_172458_create_budgets_table.php │ ├── 2023_07_31_184044_create_recurrings_table.php │ ├── 2017_11_15_124230_create_wallets_table.php │ ├── 2018_11_06_222923_create_transactions_table.php │ └── 2018_11_07_192923_create_transfers_table.php └── factories │ └── UserFactory.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── resources ├── js │ ├── app.js │ └── bootstrap.js ├── css │ └── app.css ├── svg │ ├── goal.svg │ ├── receipt.svg │ ├── helping-hand.svg │ └── badge-dollar-sign.svg └── views │ ├── vendor │ └── filament-panels │ │ └── components │ │ └── logo.blade.php │ ├── tables │ └── columns │ │ └── icon-color-column.blade.php │ └── banner.blade.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore ├── debugbar │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── img.png ├── screenshots ├── dinero-budgets.png ├── dinero-debts.png ├── dinero-goals.png ├── dinero-tenants.png ├── dinero-wallets.png ├── dinero-dashboard.png ├── dinero-categories.png ├── dinero-my-profile.png └── dinero-transactions.png ├── postcss.config.js ├── app ├── Enums │ ├── WalletTypeEnum.php │ ├── VisibilityStatusEnum.php │ ├── SpendTypeEnum.php │ ├── QuarterEnum.php │ ├── RecurringTypeEnum.php │ ├── TransferStatusEnum.php │ ├── WeekdayEnum.php │ ├── MonthEnum.php │ ├── DebtTypeEnum.php │ ├── BudgetPeriodEnum.php │ ├── TransactionTypeEnum.php │ └── DebtActionTypeEnum.php ├── Filament │ ├── Pages │ │ ├── Dashboard.php │ │ ├── Auth │ │ │ └── Login.php │ │ └── Tenancy │ │ │ ├── EditAccountProfile.php │ │ │ └── RegisterAccount.php │ ├── Resources │ │ ├── DebtResource │ │ │ ├── Pages │ │ │ │ ├── CreateDebt.php │ │ │ │ └── EditDebt.php │ │ │ └── RelationManagers │ │ │ │ └── TransactionsRelationManager.php │ │ ├── GoalResource │ │ │ ├── Pages │ │ │ │ ├── CreateGoal.php │ │ │ │ ├── EditGoal.php │ │ │ │ └── ListGoals.php │ │ │ └── RelationManagers │ │ │ │ └── TransactionsRelationManager.php │ │ ├── BudgetResource │ │ │ └── Pages │ │ │ │ ├── CreateBudget.php │ │ │ │ ├── ListBudgets.php │ │ │ │ └── EditBudget.php │ │ ├── WalletResource │ │ │ ├── Pages │ │ │ │ ├── CreateWallet.php │ │ │ │ ├── EditWallet.php │ │ │ │ └── ListWallets.php │ │ │ └── RelationManagers │ │ │ │ └── TransactionsRelationManager.php │ │ ├── CategoryResource │ │ │ ├── Pages │ │ │ │ ├── CreateCategory.php │ │ │ │ ├── EditCategory.php │ │ │ │ └── ListCategories.php │ │ │ └── RelationManagers │ │ │ │ └── TransactionsRelationManager.php │ │ └── TransactionResource │ │ │ └── Pages │ │ │ ├── EditTransaction.php │ │ │ ├── ListTransactions.php │ │ │ └── CreateTransaction.php │ └── Widgets │ │ ├── LatestTransaction.php │ │ └── CategoryChart.php ├── Models │ ├── BudgetCategory.php │ ├── Member.php │ ├── Recurring.php │ ├── AccountMemberInvitation.php │ ├── Budget.php │ ├── Goal.php │ ├── Category.php │ ├── Account.php │ ├── Wallet.php │ ├── User.php │ └── Transaction.php ├── Tables │ └── Columns │ │ └── IconColorColumn.php ├── Http │ ├── Controllers │ │ └── Controller.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── Authenticate.php │ │ ├── ValidateSignature.php │ │ ├── TrustProxies.php │ │ └── RedirectIfAuthenticated.php │ └── Kernel.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AuthServiceProvider.php │ ├── AppServiceProvider.php │ ├── EventServiceProvider.php │ ├── RouteServiceProvider.php │ └── Filament │ │ └── AdminPanelProvider.php ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Support │ └── helpers.php └── Transformer │ ├── FilamentTransferDtoTransformer.php │ └── FilamentTransactionDtoTransformer.php ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .gitattributes ├── .editorconfig ├── .gitignore ├── docker-compose.yml ├── tailwind.config.js ├── vite.config.js ├── package.json ├── routes ├── web.php ├── channels.php ├── api.php └── console.php ├── lang └── en │ ├── pagination.php │ ├── auth.php │ ├── goals.php │ ├── passwords.php │ ├── categories.php │ ├── budgets.php │ ├── wallets.php │ ├── debts.php │ ├── utilities.php │ └── transactions.php ├── config ├── cors.php ├── services.php ├── view.php ├── filament.php ├── hashing.php ├── broadcasting.php ├── sanctum.php ├── filesystems.php ├── icon-picker.php ├── cache.php ├── queue.php ├── mail.php └── auth.php ├── LICENSE ├── phpunit.xml ├── .env.example ├── artisan ├── Dockerfile ├── composer.json └── README.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/config/nginx.conf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /docker/app/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/js/filament/tables/tables.js: -------------------------------------------------------------------------------- 1 | (()=>{})(); 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 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 | -------------------------------------------------------------------------------- /img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/img.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /public/brands/dinero-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/public/brands/dinero-logo.png -------------------------------------------------------------------------------- /screenshots/dinero-budgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-budgets.png -------------------------------------------------------------------------------- /screenshots/dinero-debts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-debts.png -------------------------------------------------------------------------------- /screenshots/dinero-goals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-goals.png -------------------------------------------------------------------------------- /screenshots/dinero-tenants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-tenants.png -------------------------------------------------------------------------------- /screenshots/dinero-wallets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-wallets.png -------------------------------------------------------------------------------- /public/brands/dinero-favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/public/brands/dinero-favicon.png -------------------------------------------------------------------------------- /screenshots/dinero-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-dashboard.png -------------------------------------------------------------------------------- /public/brands/dinero-logo-adm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/public/brands/dinero-logo-adm.png -------------------------------------------------------------------------------- /public/brands/dinero-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/public/brands/dinero-logo-white.png -------------------------------------------------------------------------------- /screenshots/dinero-categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-categories.png -------------------------------------------------------------------------------- /screenshots/dinero-my-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-my-profile.png -------------------------------------------------------------------------------- /screenshots/dinero-transactions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shipu/dinero/HEAD/screenshots/dinero-transactions.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } -------------------------------------------------------------------------------- /public/css/awcodes/filament-badgeable-column/filament-badgeable-column.css: -------------------------------------------------------------------------------- 1 | .badgeable-column-badge .truncate{overflow: visible !important;} 2 | -------------------------------------------------------------------------------- /docker/app/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | #php-fpm --daemonize && nginx -g 'daemon off;' 5 | supervisord -c /etc/supervisor/conf.d/worker.conf 6 | -------------------------------------------------------------------------------- /app/Enums/WalletTypeEnum.php: -------------------------------------------------------------------------------- 1 | 0&&(this.$el.style.height=e+"rem",this.$el.style.height=this.$el.scrollHeight+"px")}}}export{t as default}; 2 | -------------------------------------------------------------------------------- /app/Filament/Pages/Dashboard.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /app/Enums/SpendTypeEnum.php: -------------------------------------------------------------------------------- 1 | value; 14 | }, self::cases()); 15 | } 16 | } -------------------------------------------------------------------------------- /app/Filament/Resources/DebtResource/Pages/CreateDebt.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/Pages/CreateCategory.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /resources/svg/helping-hand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel, { refreshPaths } from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: [ 9 | ...refreshPaths, 10 | 'app/Livewire/**', 11 | ], 12 | }), 13 | ], 14 | }); 15 | -------------------------------------------------------------------------------- /app/Enums/QuarterEnum.php: -------------------------------------------------------------------------------- 1 | value; 16 | }, self::cases()); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/Enums/RecurringTypeEnum.php: -------------------------------------------------------------------------------- 1 | value; 17 | }, self::cases()); 18 | } 19 | } -------------------------------------------------------------------------------- /database/seeders/UserSeeder.php: -------------------------------------------------------------------------------- 1 | count(1)->create([ 16 | 'name' => 'Shipu Ahamed', 17 | 'email' => 'demo@dinero.app' 18 | ]); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Enums/TransferStatusEnum.php: -------------------------------------------------------------------------------- 1 | value; 17 | }, self::cases()); 18 | } 19 | } -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "devDependencies": { 9 | "@tailwindcss/forms": "^0.5.4", 10 | "@tailwindcss/typography": "^0.5.9", 11 | "autoprefixer": "^10.4.14", 12 | "axios": "^1.1.2", 13 | "laravel-vite-plugin": "^0.7.5", 14 | "postcss": "^8.4.27", 15 | "tailwindcss": "^3.3.3", 16 | "vite": "^4.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Filament/Resources/DebtResource/Pages/EditDebt.php: -------------------------------------------------------------------------------- 1 | value; 19 | }, self::cases()); 20 | } 21 | } -------------------------------------------------------------------------------- /app/Filament/Resources/BudgetResource/Pages/ListBudgets.php: -------------------------------------------------------------------------------- 1 | environment('local')) { 13 | $this->form->fill([ 14 | 'email' => 'demo@dinero.app', 15 | 'password' => '12345678', 16 | 'remember' => true, 17 | ]); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/svg/badge-dollar-sign.svg: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Filament/Resources/BudgetResource/Pages/EditBudget.php: -------------------------------------------------------------------------------- 1 | schema([ 21 | TextInput::make('name'), 22 | ]); 23 | } 24 | } -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/Pages/EditCategory.php: -------------------------------------------------------------------------------- 1 | getName() === 'filament.hub.auth.login') 2 | {{config('app.name')}} 8 | @else 9 | {{config('app.name')}} 14 | @endif 15 | 16 | {{-- Precisa somente de uma condição para trocar as logos quando sistema esta dark e light e retirar o style --}} 17 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call([ 16 | UserSeeder::class, 17 | AccountSeeder::class, 18 | WalletSeeder::class, 19 | CategorySeeder::class, 20 | TransactionSeeder::class, 21 | GoalSeeder::class, 22 | DebtSeeder::class, 23 | ]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /app/Enums/MonthEnum.php: -------------------------------------------------------------------------------- 1 | value; 24 | }, self::cases()); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /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/Enums/DebtTypeEnum.php: -------------------------------------------------------------------------------- 1 | value; 14 | }, self::cases()); 15 | } 16 | 17 | public static function toArrayExcept(array $except): array 18 | { 19 | return array_filter(array_map(function ($value) use ($except) { 20 | if (in_array($value->value, $except)) { 21 | return null; 22 | } 23 | return $value->value; 24 | }, self::cases())); 25 | } 26 | } -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | form($form); 17 | } 18 | 19 | public function table(Table $table): Table 20 | { 21 | return (new TransactionResource())->table($table); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Filament/Resources/GoalResource/RelationManagers/TransactionsRelationManager.php: -------------------------------------------------------------------------------- 1 | form($form); 17 | } 18 | 19 | public function table(Table $table): Table 20 | { 21 | return (new TransactionResource())->table($table); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/RelationManagers/TransactionsRelationManager.php: -------------------------------------------------------------------------------- 1 | form($form); 17 | } 18 | 19 | public function table(Table $table): Table 20 | { 21 | return (new TransactionResource())->table($table); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/Filament/Resources/WalletResource/RelationManagers/TransactionsRelationManager.php: -------------------------------------------------------------------------------- 1 | form($form); 17 | } 18 | 19 | public function table(Table $table): Table 20 | { 21 | return (new TransactionResource())->table($table); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('migrate:fresh --seed')->everyFifteenMinutes(); 17 | } 18 | } 19 | 20 | /** 21 | * Register the commands for the application. 22 | */ 23 | protected function commands(): void 24 | { 25 | $this->load(__DIR__.'/Commands'); 26 | 27 | require base_path('routes/console.php'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Enums/BudgetPeriodEnum.php: -------------------------------------------------------------------------------- 1 | value; 16 | }, self::cases()); 17 | } 18 | 19 | public static function toArrayExcept(array $except): array 20 | { 21 | return array_filter(array_map(function ($value) use ($except) { 22 | if (in_array($value->value, $except)) { 23 | return null; 24 | } 25 | return $value->value; 26 | }, self::cases())); 27 | } 28 | } -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $dontFlash = [ 16 | 'current_password', 17 | 'password', 18 | 'password_confirmation', 19 | ]; 20 | 21 | /** 22 | * Register the exception handling callbacks for the application. 23 | */ 24 | public function register(): void 25 | { 26 | $this->reportable(function (Throwable $e) { 27 | // 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Enums/TransactionTypeEnum.php: -------------------------------------------------------------------------------- 1 | value; 16 | }, self::cases()); 17 | } 18 | 19 | public static function toArrayExcept($except): array 20 | { 21 | return array_filter(array_map(function ($value) use ($except) { 22 | if (in_array($value->value, $except)) { 23 | return null; 24 | } 25 | return $value->value; 26 | }, self::cases())); 27 | } 28 | } -------------------------------------------------------------------------------- /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/2014_10_12_100000_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /resources/views/tables/columns/icon-color-column.blade.php: -------------------------------------------------------------------------------- 1 |
color)) 4 | @style([ 5 | "background-color: {$getRecord()->color}" => $getRecord()->color, 6 | ]) 7 | @endif 8 | > 9 | @if ($icon = $getState()) 10 | 11 | @elseif(!blank($getRecord()->color)) 12 |
color}" => $getRecord()->color, 18 | ]) 19 | >
20 | @endif 21 |
22 | -------------------------------------------------------------------------------- /app/Filament/Resources/TransactionResource/Pages/EditTransaction.php: -------------------------------------------------------------------------------- 1 | 'Goals', 8 | 'title_singular' => 'Goal', 9 | 'actions' => [ 10 | 'deposit' => 'Deposit', 11 | 'withdraw' => 'Withdraw', 12 | ], 13 | 'fields' => [ 14 | 'name' => 'Name', 15 | 'amount' => 'Amount', 16 | 'target_date' => 'Target Date', 17 | 'currency_code' => 'Currency Code', 18 | 'color' => 'Color', 19 | 'wallet' => 'Wallet', 20 | 'from_wallet' => 'From Wallet', 21 | 'to_wallet' => 'To Wallet', 22 | 'goal' => 'Goal', 23 | 'target_amount' => 'Target Amount', 24 | 'balance' => 'Balance', 25 | 'target_from' => 'Target From', 26 | 'target_until' => 'Target Until', 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/js/filament/forms/components/tags-input.js: -------------------------------------------------------------------------------- 1 | function i({state:a,splitKeys:n}){return{newTag:"",state:a,createTag:function(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag:function(t){this.state=this.state.filter(e=>e!==t)},reorderTags:function(t){let e=this.state.splice(t.oldIndex,1)[0];this.state.splice(t.newIndex,0,e),this.state=[...this.state]},input:{["x-on:blur"]:"createTag()",["x-model"]:"newTag",["x-on:keydown"](t){["Enter",...n].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.createTag())},["x-on:paste"](){this.$nextTick(()=>{if(n.length===0){this.createTag();return}let t=n.map(e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")).join("|");this.newTag.split(new RegExp(t,"g")).forEach(e=>{this.newTag=e,this.createTag()})})}}}}export{i as default}; 2 | -------------------------------------------------------------------------------- /database/migrations/2023_07_25_164549_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 | -------------------------------------------------------------------------------- /docker/app/supervisor.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:nginx] 5 | command=nginx -g 'daemon off;' 6 | process_name=%(program_name)s_%(process_num)02d 7 | numprocs=1 8 | autostart=true 9 | autorestart=false 10 | startsecs=0 11 | redirect_stderr=true 12 | stdout_logfile=/dev/stdout 13 | stdout_logfile_maxbytes=0 14 | 15 | [program:php-fpm] 16 | command=php-fpm --daemonize 17 | process_name=%(program_name)s_%(process_num)02d 18 | numprocs=1 19 | autostart=true 20 | autorestart=false 21 | startsecs=0 22 | redirect_stderr=true 23 | stdout_logfile=/dev/stdout 24 | stdout_logfile_maxbytes=0 25 | 26 | [program:laravel-worker-schedule] 27 | process_name=%(program_name)s_%(process_num)02d 28 | directory=/var/www/html 29 | command=php artisan schedule:work 30 | autostart=true 31 | autorestart=true 32 | user=root 33 | numprocs=1 34 | redirect_stderr=true 35 | stdout_logfile= /var/www/html/storage/logs/worker1.log 36 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2023_07_25_173733_create_account_manager_invitations_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 18 | $table->string('email'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('account_member_invitations'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2015_07_25_170745_create_accounts_table.php: -------------------------------------------------------------------------------- 1 | ulid('id')->index()->primary(); 17 | $table->string('name')->unique()->index(); 18 | $table->foreignIdFor(User::class, 'owner_id')->constrained((new User())->getTable())->cascadeOnDelete(); 19 | $table->softDeletes(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('accounts'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2023_07_25_171709_account_member_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 19 | $table->foreignIdFor(User::class)->constrained((new User())->getTable())->cascadeOnDelete(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('account_member'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /public/js/filament/forms/components/key-value.js: -------------------------------------------------------------------------------- 1 | function r({state:i}){return{state:i,rows:[],shouldUpdateRows:!0,init:function(){this.updateRows(),this.rows.length<=0?this.rows.push({key:"",value:""}):this.updateState(),this.$watch("state",(t,e)=>{let s=o=>o===null?0:Array.isArray(o)?o.length:typeof o!="object"?0:Object.keys(o).length;s(t)===0&&s(e)===0||this.updateRows()})},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(t){this.rows.splice(t,1),this.rows.length<=0&&this.addRow(),this.updateState()},reorderRows:function(t){let e=Alpine.raw(this.rows),s=e.splice(t.oldIndex,1)[0];e.splice(t.newIndex,0,s),this.rows=e,this.updateState()},updateRows:function(){if(!this.shouldUpdateRows){this.shouldUpdateRows=!0;return}let t=[];for(let[e,s]of Object.entries(this.state??{}))t.push({key:e,value:s});this.rows=t},updateState:function(){let t={};this.rows.forEach(e=>{e.key===""||e.key===null||(t[e.key]=e.value)}),this.shouldUpdateRows=!1,this.state=t}}}export{r as default}; 2 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /database/migrations/2023_07_31_173915_create_budget_category_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignIdFor(Budget::class)->constrained((new Budget())->getTable())->cascadeOnDelete(); 19 | $table->foreignIdFor(Category::class)->constrained((new Category())->getTable())->cascadeOnDelete(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('budget_category'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /app/Support/helpers.php: -------------------------------------------------------------------------------- 1 | mapWithKeys(function ($country) { 7 | try { 8 | $currency = currency($country['currency']); 9 | return [ 10 | $country['currency'] => sprintf('%s - %s - %s (%s)',$country['name'], $currency->getCurrency(), $currency->getName(), $currency->getSymbol()) 11 | ]; 12 | } catch (\Exception $e) { 13 | return [null => null]; 14 | } 15 | })->filter(); 16 | 17 | if($state) { 18 | return $countries->get($state); 19 | } 20 | 21 | return $countries; 22 | } 23 | 24 | function month_ordinal_numbers(): Collection 25 | { 26 | return collect(range(1, 31))->map(fn ($day) => sprintf('%s%s', $day, match ($day) { 27 | 1 => 'st', 28 | 2 => 'nd', 29 | 3 => 'rd', 30 | default => 'th' 31 | })); 32 | } -------------------------------------------------------------------------------- /lang/en/categories.php: -------------------------------------------------------------------------------- 1 | 'Categories', 7 | 'title_singular' => 'Category', 8 | 'fields' => [ 9 | 'name' => 'Name', 10 | 'type' => 'Type', 11 | 'icon' => 'Icon', 12 | 'color' => 'Color', 13 | 'monthly_balance' => 'Monthly Balance', 14 | 'total' => 'Total', 15 | 'is_visible' => 'Is Visible?', 16 | 'is_visible_help_text' => 'Ignore this category on the total balance and not showing on the transaction list', 17 | ], 18 | 'types' => [ 19 | SpendTypeEnum::INCOME->value => [ 20 | 'id' => SpendTypeEnum::INCOME->value, 21 | 'label' => 'Income', 22 | 'description' => 'your income category', 23 | ], 24 | SpendTypeEnum::EXPENSE->value => [ 25 | 'id' => SpendTypeEnum::EXPENSE->value, 26 | 'label' => 'Expense', 27 | 'description' => 'your expense category', 28 | ], 29 | ] 30 | ]; 31 | -------------------------------------------------------------------------------- /app/Enums/DebtActionTypeEnum.php: -------------------------------------------------------------------------------- 1 | value; 18 | }, self::cases()); 19 | } 20 | 21 | public static function toArrayExcept(array $except): array 22 | { 23 | return array_filter(array_map(function ($value) use ($except) { 24 | if (in_array($value->value, $except)) { 25 | return null; 26 | } 27 | return $value->value; 28 | }, self::cases())); 29 | } 30 | } -------------------------------------------------------------------------------- /database/seeders/AccountSeeder.php: -------------------------------------------------------------------------------- 1 | Ulid::generate(), 23 | 'name' => 'Personal', 24 | 'owner_id' => $user->id, 25 | ], 26 | [ 27 | 'id' => Ulid::generate(), 28 | 'name' => 'Business', 29 | 'owner_id' => $user->id, 30 | ], 31 | [ 32 | 'id' => Ulid::generate(), 33 | 'name' => 'Family', 34 | 'owner_id' => $user->id, 35 | ] 36 | ]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Filament/Widgets/LatestTransaction.php: -------------------------------------------------------------------------------- 1 | query(TransactionResource::getEloquentQuery()) 22 | ->defaultPaginationPageOption(5) 23 | ->defaultSort('happened_at', 'desc') 24 | ->columns((new TransactionResource())->tableColumns()) 25 | ->actions([ 26 | Action::make('view') 27 | ->url(fn (Transaction $record): string => TransactionResource::getUrl('edit', ['record' => $record])), 28 | ]); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory 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' => fake()->name(), 22 | 'email' => fake()->unique()->safeEmail(), 23 | 'email_verified_at' => now(), 24 | 'password' => bcrypt('12345678'), 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | } 28 | 29 | /** 30 | * Indicate that the model's email address should be unverified. 31 | */ 32 | public function unverified(): static 33 | { 34 | return $this->state(fn (array $attributes) => [ 35 | 'email_verified_at' => null, 36 | ]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2023_07_31_182107_create_goals_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 19 | $table->unsignedDecimal('amount', 64, 0)->default(0); 20 | $table->timestamp('target_date')->nullable(); 21 | $table->string('color')->nullable(); 22 | $table->string('currency_code')->default('USD'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('goals'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->string('email')->unique(); 19 | $table->timestamp('email_verified_at')->nullable(); 20 | $table->string('avatar_url')->nullable(); 21 | $table->string('password'); 22 | $table->ulid('latest_account_id')->nullable(); 23 | $table->rememberToken(); 24 | $table->softDeletes(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | */ 32 | public function down(): void 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Shipu Ahamed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lang/en/budgets.php: -------------------------------------------------------------------------------- 1 | 'Budgets', 9 | 'title_singular' => 'Budget', 10 | 'fields' => [ 11 | 'name' => 'Name', 12 | 'amount' => 'Amount', 13 | 'actual_amount' => 'Actual Amount', 14 | 'spend_amount' => 'Spend Amount', 15 | 'period' => 'Period', 16 | 'day_of_month' => 'Day of Month', 17 | 'day_of_week' => 'Day of Week', 18 | 'month_of_year' => 'Month of Year', 19 | 'month_of_quarter' => 'Month of Quarter', 20 | 'status' => 'Status', 21 | 'color' => 'Color', 22 | 'categories' => 'Categories', 23 | 'recurrence' => 'Recurrence', 24 | 'enabled' => 'Enabled ?', 25 | 'enabled_help_text' => 'Show this budget on the dashboard or report', 26 | ], 27 | 'periods' => [ 28 | BudgetPeriodEnum::WEEKLY->value => 'Weekly', 29 | BudgetPeriodEnum::MONTHLY->value => 'Monthly', 30 | BudgetPeriodEnum::QUARTERLY->value => 'Quarterly', 31 | BudgetPeriodEnum::YEARLY->value => 'Yearly', 32 | ], 33 | ]; 34 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests/Unit 10 | 11 | 12 | tests/Feature 13 | 14 | 15 | 16 | 17 | app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/Filament/Pages/Tenancy/RegisterAccount.php: -------------------------------------------------------------------------------- 1 | schema([ 37 | TextInput::make('name') 38 | ->placeholder('Personal Account'), 39 | ]); 40 | } 41 | 42 | protected function handleRegistration(array $data): Account 43 | { 44 | return auth()->user()->ownedAccounts()->create($data); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Transformer/FilamentTransferDtoTransformer.php: -------------------------------------------------------------------------------- 1 | optional(Filament::getTenant())->id ?? $dto->getMeta()['account_id'] ?? null, 17 | 'uuid' => $dto->getUuid(), 18 | 'deposit_id' => $dto->getDepositId(), 19 | 'withdraw_id' => $dto->getWithdrawId(), 20 | 'status' => $dto->getStatus(), 21 | 'from_type' => $dto->getFromType(), 22 | 'from_id' => $dto->getFromId(), 23 | 'to_type' => $dto->getToType(), 24 | 'to_id' => $dto->getToId(), 25 | 'discount' => $dto->getDiscount(), 26 | 'fee' => $dto->getFee(), 27 | 'created_at' => $dto->getCreatedAt(), 28 | 'updated_at' => $dto->getUpdatedAt(), 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lang/en/wallets.php: -------------------------------------------------------------------------------- 1 | 'Wallets', 7 | 'title_singular' => 'Wallet', 8 | 'actions' => [ 9 | 'refresh_balance' => 'Refresh Balance', 10 | ], 11 | 'notifications' => [ 12 | 'balance_refreshed' => 'Balance Refreshed', 13 | ], 14 | 'fields' => [ 15 | 'name' => 'Name', 16 | 'type' => 'Type', 17 | 'balance' => 'Balance', 18 | 'initial_balance' => 'Initial Balance', 19 | 'credit_limit' => 'Credit Limit', 20 | 'total_due' => 'Currently Total Due', 21 | 'currency_code' => 'Currency', 22 | 'description' => 'Description', 23 | 'statement_day_of_month' => 'Statement Day of Month', 24 | 'payment_due_day_of_month' => 'Payment Due Day of Month', 25 | 'icon' => 'Icon', 26 | 'color' => 'Color', 27 | 'exclude' => [ 28 | 'title' => 'Exclude', 29 | 'help_text' => 'Ignore this balance of this wallet on the total balance', 30 | ] 31 | ], 32 | 'types' => [ 33 | WalletTypeEnum::GENERAL->value => 'General', 34 | WalletTypeEnum::CREDIT_CARD->value => 'Credit Card', 35 | ] 36 | ]; 37 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | by($request->user()?->id ?: $request->ip()); 29 | }); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /config/filament.php: -------------------------------------------------------------------------------- 1 | [ 18 | 19 | // 'echo' => [ 20 | // 'broadcaster' => 'pusher', 21 | // 'key' => env('VITE_PUSHER_APP_KEY'), 22 | // 'cluster' => env('VITE_PUSHER_APP_CLUSTER'), 23 | // 'forceTLS' => true, 24 | // ], 25 | 26 | ], 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Default Filesystem Disk 31 | |-------------------------------------------------------------------------- 32 | | 33 | | This is the storage disk Filament will use to put media. You may use any 34 | | of the disks defined in the `config/filesystems.php`. 35 | | 36 | */ 37 | 38 | 'default_filesystem_disk' => env('FILAMENT_FILESYSTEM_DISK', 'public'), 39 | 40 | ]; 41 | -------------------------------------------------------------------------------- /database/migrations/2023_07_25_155250_create_breezy_tables.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('authenticatable_type'); 16 | $table->unsignedBigInteger('authenticatable_id'); 17 | $table->string('panel_id')->nullable(); 18 | $table->string('guard')->nullable(); 19 | $table->string('ip_address', 45)->nullable(); 20 | $table->text('user_agent')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->text('two_factor_secret') 23 | ->nullable(); 24 | $table->text('two_factor_recovery_codes') 25 | ->nullable(); 26 | $table->timestamp('two_factor_confirmed_at') 27 | ->nullable(); 28 | $table->timestamps(); 29 | }); 30 | 31 | } 32 | 33 | public function down() 34 | { 35 | Schema::dropIfExists('breezy_sessions'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2023_07_31_183330_create_debts_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('type'); 20 | $table->unsignedDecimal('amount')->default(0); 21 | $table->text('description')->nullable(); 22 | $table->timestamp('start_at')->nullable(); 23 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 24 | $table->foreignIdFor(Wallet::class)->constrained((new Wallet())->getTable())->cascadeOnDelete(); 25 | $table->string('color')->nullable(); 26 | $table->softDeletes(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | */ 34 | public function down(): void 35 | { 36 | Schema::dropIfExists('debts'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Dinero 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://dinero.test 6 | APP_DEMO=false 7 | 8 | LOG_CHANNEL=stack 9 | LOG_DEPRECATIONS_CHANNEL=null 10 | LOG_LEVEL=debug 11 | 12 | DB_CONNECTION=mysql 13 | DB_HOST=127.0.0.1 14 | DB_PORT=3306 15 | DB_DATABASE=dinero 16 | DB_USERNAME=root 17 | DB_PASSWORD= 18 | 19 | BROADCAST_DRIVER=log 20 | CACHE_DRIVER=file 21 | FILESYSTEM_DISK=local 22 | QUEUE_CONNECTION=sync 23 | SESSION_DRIVER=file 24 | SESSION_LIFETIME=120 25 | 26 | MEMCACHED_HOST=127.0.0.1 27 | 28 | REDIS_HOST=127.0.0.1 29 | REDIS_PASSWORD=null 30 | REDIS_PORT=6379 31 | 32 | MAIL_MAILER=smtp 33 | MAIL_HOST=mailpit 34 | MAIL_PORT=1025 35 | MAIL_USERNAME=null 36 | MAIL_PASSWORD=null 37 | MAIL_ENCRYPTION=null 38 | MAIL_FROM_ADDRESS="hello@example.com" 39 | MAIL_FROM_NAME="${APP_NAME}" 40 | 41 | AWS_ACCESS_KEY_ID= 42 | AWS_SECRET_ACCESS_KEY= 43 | AWS_DEFAULT_REGION=us-east-1 44 | AWS_BUCKET= 45 | AWS_USE_PATH_STYLE_ENDPOINT=false 46 | 47 | PUSHER_APP_ID= 48 | PUSHER_APP_KEY= 49 | PUSHER_APP_SECRET= 50 | PUSHER_HOST= 51 | PUSHER_PORT=443 52 | PUSHER_SCHEME=https 53 | PUSHER_APP_CLUSTER=mt1 54 | 55 | VITE_APP_NAME="${APP_NAME}" 56 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 57 | VITE_PUSHER_HOST="${PUSHER_HOST}" 58 | VITE_PUSHER_PORT="${PUSHER_PORT}" 59 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 60 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 61 | -------------------------------------------------------------------------------- /database/migrations/2015_07_27_225207_create_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 19 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 20 | $table->string('name'); 21 | $table->string('type')->comment(implode(',', SpendTypeEnum::toArray())); 22 | $table->string('slug')->index(); 23 | $table->string('icon')->nullable(); 24 | $table->string('color')->nullable(); 25 | $table->integer('order')->default(0); 26 | $table->string('status')->default(VisibilityStatusEnum::ACTIVE->value); 27 | $table->softDeletes(); 28 | $table->timestamps(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | */ 35 | public function down(): void 36 | { 37 | Schema::dropIfExists('categories'); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /database/seeders/DebtSeeder.php: -------------------------------------------------------------------------------- 1 | DebtTypeEnum::PAYABLE->value, 21 | 'name' => fake()->name, 22 | 'description' => 'Borrowed money from John Doe for buying a new car', 23 | 'amount' => 800000, 24 | 'start_at' => now()->addYears(2), 25 | 'account_id' => Account::first()->id, 26 | 'wallet_id' => Wallet::first()->id, 27 | 'color' => '#22b3e0', 28 | ]); 29 | 30 | Debt::create([ 31 | 'type' => DebtTypeEnum::RECEIVABLE->value, 32 | 'name' => fake()->name, 33 | 'description' => 'Received money from John Doe for buying a new phone', 34 | 'amount' => 100000, 35 | 'start_at' => now()->addYears(2), 36 | 'account_id' => Account::first()->id, 37 | 'wallet_id' => Wallet::first()->id, 38 | 'color' => '#22b3e0', 39 | ]); 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * We'll load the axios HTTP library which allows us to easily issue requests 3 | * to our Laravel back-end. This library automatically handles sending the 4 | * CSRF token as a header based on the value of the "XSRF" token cookie. 5 | */ 6 | 7 | import axios from 'axios'; 8 | window.axios = axios; 9 | 10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 11 | 12 | /** 13 | * Echo exposes an expressive API for subscribing to channels and listening 14 | * for events that are broadcast by Laravel. Echo and event broadcasting 15 | * allows your team to easily build robust real-time web applications. 16 | */ 17 | 18 | // import Echo from 'laravel-echo'; 19 | 20 | // import Pusher from 'pusher-js'; 21 | // window.Pusher = Pusher; 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 31 | // enabledTransports: ['ws', 'wss'], 32 | // }); 33 | -------------------------------------------------------------------------------- /app/Transformer/FilamentTransactionDtoTransformer.php: -------------------------------------------------------------------------------- 1 | $dto->getMeta()['happened_at'] ?? now(), // '2021-01-01 00:00:00 15 | 'reference_type' => $dto->getMeta()['reference_type'] ?? null, 16 | 'reference_id' => $dto->getMeta()['reference_id'] ?? null, 17 | 'category_id' => $dto->getMeta()['category_id'] ?? null, 18 | 'account_id' => optional(Filament::getTenant())->id ?? $dto->getMeta()['account_id'] ?? null, 19 | 'uuid' => $dto->getUuid(), 20 | 'payable_type' => $dto->getPayableType(), 21 | 'payable_id' => $dto->getPayableId(), 22 | 'wallet_id' => $dto->getWalletId(), 23 | 'type' => $dto->getType(), 24 | 'amount' => $dto->getAmount(), 25 | 'confirmed' => $dto->isConfirmed(), 26 | 'meta' => $dto->getMeta(), 27 | 'created_at' => $dto->getCreatedAt(), 28 | 'updated_at' => $dto->getUpdatedAt(), 29 | ]; 30 | } 31 | } -------------------------------------------------------------------------------- /docker/nginx/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | # Set the port to listen on and the server name 3 | listen 80; 4 | 5 | # Set the document root of the project 6 | root /var/www/html/public; 7 | 8 | # Set the directory index files 9 | index index.php index.html index.htm; 10 | 11 | # Specify the default character set 12 | charset utf-8; 13 | 14 | # Setup the default location configuration 15 | location / { 16 | try_files $uri $uri/ /index.php$is_args$args; 17 | } 18 | 19 | # Specify the details of favicon.ico 20 | location = /favicon.ico { access_log off; log_not_found off; } 21 | 22 | # Specify the details of robots.txt 23 | location = /robots.txt { access_log off; log_not_found off; } 24 | 25 | # Specify the logging configuration 26 | access_log /var/log/nginx/access.log; 27 | error_log /var/log/nginx/error.log; 28 | 29 | sendfile off; 30 | 31 | client_max_body_size 100m; 32 | 33 | # Specify what happens when PHP files are requested 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | fastcgi_pass localhost:9000; 37 | fastcgi_index index.php; 38 | include fastcgi_params; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | fastcgi_intercept_errors off; 41 | fastcgi_buffer_size 16k; 42 | fastcgi_buffers 4 16k; 43 | } 44 | 45 | # deny access to .htaccess files 46 | location ~ /\.ht { 47 | deny all; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /database/migrations/2023_07_31_172458_create_budgets_table.php: -------------------------------------------------------------------------------- 1 | id(); 19 | $table->string('name'); 20 | $table->unsignedDecimal('amount')->default(0); 21 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 22 | $table->string('color')->nullable(); 23 | $table->string('period')->comment(implode(',', BudgetPeriodEnum::toArray())); 24 | $table->string('day_of_week')->nullable(); 25 | $table->string('day_of_month')->nullable(); 26 | $table->string('month_of_quarter')->nullable(); 27 | $table->string('month_of_year')->nullable(); 28 | $table->string('status')->default(\App\Enums\VisibilityStatusEnum::ACTIVE->value); 29 | $table->softDeletes(); 30 | $table->timestamps(); 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | */ 37 | public function down(): void 38 | { 39 | Schema::dropIfExists('budgets'); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /lang/en/debts.php: -------------------------------------------------------------------------------- 1 | 'Debts', 8 | 'title_singular' => 'Debt', 9 | 'actions' => [ 10 | 'debt_transaction' => 'Debt Transaction', 11 | ], 12 | 'fields' => [ 13 | 'name' => 'Name', 14 | 'type' => 'Type', 15 | 'amount' => 'Amount', 16 | 'description' => 'Description', 17 | 'start_at' => 'Start', 18 | 'color' => 'Color', 19 | 'wallet' => 'Wallet', 20 | 'initial_wallet' => 'Initial Wallet', 21 | 'happened_at' => 'Happened', 22 | 'debt' => 'Debt', 23 | 'action_type' => 'Action Type', 24 | 'from_wallet' => 'From Wallet', 25 | 'total_debt_amount' => 'Total Debt Amount', 26 | ], 27 | 'types' => [ 28 | DebtTypeEnum::PAYABLE->value => 'Payable', 29 | DebtTypeEnum::RECEIVABLE->value => 'Receivable', 30 | ], 31 | 'action_types' => [ 32 | DebtTypeEnum::RECEIVABLE->value => [ 33 | DebtActionTypeEnum::DEBT_COLLECTION->value => 'Debt Collection', 34 | DebtActionTypeEnum::LOAN_INCREASE->value => 'Loan Increase', 35 | DebtActionTypeEnum::LOAN_INTEREST->value => 'Interest', 36 | ], 37 | DebtTypeEnum::PAYABLE->value => [ 38 | DebtActionTypeEnum::REPAYMENT->value => 'Repayment', 39 | DebtActionTypeEnum::DEBT_INCREASE->value => 'Debt Increase', 40 | DebtActionTypeEnum::DEBT_INTEREST->value => 'Interest', 41 | ], 42 | ] 43 | ]; 44 | -------------------------------------------------------------------------------- /app/Filament/Resources/CategoryResource/Pages/ListCategories.php: -------------------------------------------------------------------------------- 1 | slideOver(), 21 | ]; 22 | } 23 | 24 | public function getTabs(): array 25 | { 26 | return [ 27 | 'all' => Tab::make() 28 | ->icon('lucide-layout-list') 29 | ->badge(Category::tenant()->count()), 30 | SpendTypeEnum::EXPENSE->value => Tab::make() 31 | ->icon('lucide-trending-down') 32 | ->badge(Category::tenant()->where('type', SpendTypeEnum::EXPENSE->value)->count()) 33 | ->modifyQueryUsing(fn (Builder $query) => $query->where('type', SpendTypeEnum::EXPENSE->value)), 34 | SpendTypeEnum::INCOME->value => Tab::make() 35 | ->icon('lucide-trending-up') 36 | ->badge(Category::tenant()->where('type', SpendTypeEnum::INCOME->value)->count()) 37 | ->modifyQueryUsing(fn (Builder $query) => $query->where('type', SpendTypeEnum::INCOME->value)), 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Filament/Resources/WalletResource/Pages/ListWallets.php: -------------------------------------------------------------------------------- 1 | slideOver(), 21 | ]; 22 | } 23 | 24 | public function getTabs(): array 25 | { 26 | return [ 27 | 'all' => Tab::make() 28 | ->icon('lucide-wallet') 29 | ->badge(Wallet::tenant()->count()), 30 | WalletTypeEnum::GENERAL->value => Tab::make() 31 | ->icon('badge-dollar-sign') 32 | ->badge(Wallet::tenant()->where('type', WalletTypeEnum::GENERAL->value)->count()) 33 | ->modifyQueryUsing(fn (Builder $query) => $query->tenant()->where('type', WalletTypeEnum::GENERAL->value)), 34 | WalletTypeEnum::CREDIT_CARD->value => Tab::make() 35 | ->icon('lucide-credit-card') 36 | ->badge(Wallet::tenant()->where('type', WalletTypeEnum::CREDIT_CARD->value)->count()) 37 | ->modifyQueryUsing(fn (Builder $query) => $query->tenant()->where('type', WalletTypeEnum::CREDIT_CARD->value)), 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Models/Budget.php: -------------------------------------------------------------------------------- 1 | categories->sum('balance'); 37 | } 38 | ); 39 | } 40 | 41 | public function owner(): BelongsTo 42 | { 43 | return $this->belongsTo(Account::class, 'account_id'); 44 | } 45 | 46 | public function scopeTenant(Builder $query): Builder 47 | { 48 | return $query->where('account_id', optional(Filament::getTenant())->id); 49 | } 50 | 51 | public function categories(): BelongsToMany 52 | { 53 | return $this->belongsToMany(Category::class, 'budget_category', 'budget_id', 'category_id'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lang/en/utilities.php: -------------------------------------------------------------------------------- 1 | [ 10 | VisibilityStatusEnum::ACTIVE->value => 'Active', 11 | VisibilityStatusEnum::INACTIVE->value => 'Inactive', 12 | ], 13 | 'weekdays' => [ 14 | WeekdayEnum::SUNDAY->value => 'Sunday', 15 | WeekdayEnum::MONDAY->value => 'Monday', 16 | WeekdayEnum::TUESDAY->value => 'Tuesday', 17 | WeekdayEnum::WEDNESDAY->value => 'Wednesday', 18 | WeekdayEnum::THURSDAY->value => 'Thursday', 19 | WeekdayEnum::FRIDAY->value => 'Friday', 20 | WeekdayEnum::SATURDAY->value => 'Saturday', 21 | ], 22 | 'months' => [ 23 | MonthEnum::JANUARY->value => 'January', 24 | MonthEnum::FEBRUARY->value => 'February', 25 | MonthEnum::MARCH->value => 'March', 26 | MonthEnum::APRIL->value => 'April', 27 | MonthEnum::MAY->value => 'May', 28 | MonthEnum::JUNE->value => 'June', 29 | MonthEnum::JULY->value => 'July', 30 | MonthEnum::AUGUST->value => 'August', 31 | MonthEnum::SEPTEMBER->value => 'September', 32 | MonthEnum::OCTOBER->value => 'October', 33 | MonthEnum::NOVEMBER->value => 'November', 34 | MonthEnum::DECEMBER->value => 'December', 35 | ], 36 | 'quarter_months' => [ 37 | QuarterEnum::FIRST_MONTH->value => 'First Month', 38 | QuarterEnum::SECOND_MONTH->value => 'Second Month', 39 | QuarterEnum::THIRD_MONTH->value => 'Third Month', 40 | ] 41 | ]; -------------------------------------------------------------------------------- /app/Models/Goal.php: -------------------------------------------------------------------------------- 1 | amount > 0 ? ($this->balance / $this->amount) * 100 : 0; 31 | } 32 | ); 33 | } 34 | 35 | public function balance(): Attribute 36 | { 37 | return Attribute::make( 38 | get: function() { 39 | return $this->transactions->sum('amount_float') * -1; 40 | } 41 | ); 42 | } 43 | 44 | public function owner(): BelongsTo 45 | { 46 | return $this->belongsTo(Account::class, 'account_id'); 47 | } 48 | 49 | public function scopeTenant(Builder $query): Builder 50 | { 51 | return $query->where('account_id', optional(Filament::getTenant())->id); 52 | } 53 | 54 | public function transactions(): MorphMany 55 | { 56 | return $this->morphMany(Transaction::class, 'reference'); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /database/migrations/2023_07_31_184044_create_recurrings_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('transaction_type') 19 | ->comment(implode(',', TransactionTypeEnum::toArrayExcept([TransactionTypeEnum::TRANSFER->value]))) 20 | ->index(); 21 | $table->string('amount'); 22 | $table->text('description')->nullable(); 23 | $table->timestamp('start_at')->nullable(); 24 | $table->string('recurring_type')->default(RecurringTypeEnum::NONE->value)->comment(implode(',', RecurringTypeEnum::toArray())); 25 | $table->integer('recurring_frequency')->nullable()->comment('based on recurring_type. e.g. every 2 days, every 3 weeks, every 4 months, every 5 years'); 26 | $table->integer('total_recurring_cycles')->nullable()->comment('null means infinite. e.g. 5 means 5 times'); 27 | $table->timestamp('end_at')->nullable()->comment('null means infinite and end_at is until recurring timestamp.'); 28 | $table->timestamps(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | */ 35 | public function down(): void 36 | { 37 | Schema::dropIfExists('recurring'); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /lang/en/transactions.php: -------------------------------------------------------------------------------- 1 | 'Transactions', 9 | 'title_singular' => 'Transaction', 10 | 'fields' => [ 11 | 'amount' => 'Amount', 12 | 'confirmed' => 'Confirmed', 13 | 'category' => 'Category', 14 | 'account' => 'Account', 15 | 'happened_at' => 'Happened', 16 | 'description' => 'Description', 17 | 'type' => 'Type', 18 | 'wallet' => 'Wallet', 19 | 'from_wallet' => 'From Wallet', 20 | 'to_wallet' => 'To Wallet', 21 | 'note' => 'Note', 22 | 'attachment' => 'Attachment', 23 | ], 24 | 'types' => [ 25 | TransactionTypeEnum::DEPOSIT->value => [ 26 | 'id' => TransactionTypeEnum::DEPOSIT->value, 27 | 'label' => 'Deposit', 28 | 'description' => 'Deposit to your wallet', 29 | ], 30 | TransactionTypeEnum::WITHDRAW->value => [ 31 | 'id' => TransactionTypeEnum::WITHDRAW->value, 32 | 'label' => 'Withdraw', 33 | 'description' => 'Withdraw from your wallet', 34 | ], 35 | TransactionTypeEnum::TRANSFER->value => [ 36 | 'id' => TransactionTypeEnum::TRANSFER->value, 37 | 'label' => 'Transfer', 38 | 'description' => 'Transfer between your wallets', 39 | ], 40 | TransactionTypeEnum::PAYMENT->value => [ 41 | 'id' => TransactionTypeEnum::PAYMENT->value, 42 | 'label' => 'Payment', 43 | 'description' => 'Payment to one wallet to another wallet', 44 | ], 45 | ] 46 | ]; 47 | -------------------------------------------------------------------------------- /database/seeders/GoalSeeder.php: -------------------------------------------------------------------------------- 1 | 'Buy a new car', 20 | 'amount' => 800000, 21 | 'target_date' => now()->addYears(2), 22 | 'account_id' => Account::first()->id, 23 | 'color' => '#22b3e0', 24 | 'currency_code' => 'BDT', 25 | ], 26 | [ 27 | 'name' => 'Buy a new house', 28 | 'amount' => 3000000, 29 | 'target_date' => now()->addYears(5), 30 | 'account_id' => Account::first()->id, 31 | 'color' => '#224ce0', 32 | 'currency_code' => 'BDT', 33 | ], 34 | [ 35 | 'name' => 'Buy a new laptop', 36 | 'amount' => 100000, 37 | 'target_date' => now()->addMonths(6), 38 | 'account_id' => Account::first()->id, 39 | 'color' => '#e07222', 40 | 'currency_code' => 'BDT', 41 | ], 42 | [ 43 | 'name' => 'Buy a new phone', 44 | 'amount' => 50000, 45 | 'target_date' => now()->addMonths(3), 46 | 'account_id' => Account::first()->id, 47 | 'color' => '#22a1e0', 48 | 'currency_code' => 'BDT', 49 | ], 50 | ]); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /app/Filament/Resources/TransactionResource/Pages/ListTransactions.php: -------------------------------------------------------------------------------- 1 | Tab::make() 31 | ->icon('lucide-calculator') 32 | ->badge(Transaction::tenant()->count()), 33 | TransactionTypeEnum::WITHDRAW->value => Tab::make() 34 | ->icon('lucide-trending-down') 35 | ->badge(Transaction::tenant()->where('type', TransactionTypeEnum::WITHDRAW->value)->count()) 36 | ->modifyQueryUsing(fn (Builder $query) => $query->where('type', TransactionTypeEnum::WITHDRAW->value)), 37 | TransactionTypeEnum::DEPOSIT->value => Tab::make() 38 | ->icon('lucide-trending-up') 39 | ->badge(Transaction::tenant()->where('type', TransactionTypeEnum::DEPOSIT->value)->count()) 40 | ->modifyQueryUsing(fn (Builder $query) => $query->where('type', TransactionTypeEnum::DEPOSIT->value)), 41 | ]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /database/seeders/WalletSeeder.php: -------------------------------------------------------------------------------- 1 | 'Cash', 22 | 'type' => WalletTypeEnum::GENERAL->value, 23 | 'currency_code' => 'BDT', 24 | 'color' => '#22b3e0', 25 | ], 26 | [ 27 | 'name' => 'Bank', 28 | 'type' => WalletTypeEnum::GENERAL->value, 29 | 'currency_code' => 'BDT', 30 | 'color' => '#224ce0' 31 | ], 32 | [ 33 | 'name' => 'Mobile Wallet', 34 | 'type' => WalletTypeEnum::GENERAL->value, 35 | 'currency_code' => 'BDT', 36 | 'color' => '#e07222' 37 | ], 38 | [ 39 | 'name' => 'Credit Card', 40 | 'type' => WalletTypeEnum::CREDIT_CARD->value, 41 | 'currency_code' => 'BDT', 42 | 'color' => '#22a1e0' 43 | ] 44 | ]; 45 | 46 | $accounts = Account::all(); 47 | $user = User::first(); 48 | 49 | foreach ($accounts as $key => $account) { 50 | foreach ($wallets as $wallet) { 51 | if($key != 0 && $wallet['type'] == WalletTypeEnum::CREDIT_CARD->value) { 52 | continue; 53 | } 54 | 55 | $wallet['account_id'] = $account->id; 56 | $wallet['slug'] = strtolower($wallet['name']) . ($key != 0 ? '-' . ($key+1) : ''); 57 | $user->createWallet($wallet); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /public/js/filament/forms/forms.js: -------------------------------------------------------------------------------- 1 | (()=>{function b(n){n.directive("mask",(e,{value:t,expression:u},{effect:f,evaluateLater:c})=>{let r=()=>u,l="";queueMicrotask(()=>{if(["function","dynamic"].includes(t)){let o=c(u);f(()=>{r=a=>{let s;return n.dontAutoEvaluateFunctions(()=>{o(d=>{s=typeof d=="function"?d(a):d},{scope:{$input:a,$money:I.bind({el:e})}})}),s},i(e,!1)})}else i(e,!1);e._x_model&&e._x_model.set(e.value)}),e.addEventListener("input",()=>i(e)),e.addEventListener("blur",()=>i(e,!1));function i(o,a=!0){let s=o.value,d=r(s);if(!d||d==="false")return!1;if(l.length-o.value.length===1)return l=o.value;let g=()=>{l=o.value=p(s,d)};a?k(o,d,()=>{g()}):g()}function p(o,a){if(o==="")return"";let s=h(a,o);return m(a,s)}}).before("model")}function k(n,e,t){let u=n.selectionStart,f=n.value;t();let c=f.slice(0,u),r=m(e,h(e,c)).length;n.setSelectionRange(r,r)}function h(n,e){let t=e,u="",f={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},c="";for(let r=0;r{let o="",a=0;for(let s=i.length-1;s>=0;s--)i[s]!==p&&(a===3?(o=i[s]+p+o,a=0):o=i[s]+o,a++);return o},c=n.startsWith("-")?"-":"",r=n.replaceAll(new RegExp(`[^0-9\\${e}]`,"g"),""),l=Array.from({length:r.split(e)[0].length}).fill("9").join("");return l=`${c}${f(l,t)}`,u>0&&n.includes(e)&&(l+=`${e}`+"9".repeat(u)),queueMicrotask(()=>{this.el.value.endsWith(e)||this.el.value[this.el.selectionStart-1]===e&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),l}var v=b;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(v)});})(); 2 | -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | [ 34 | 'source' => 'name' 35 | ] 36 | ]; 37 | } 38 | 39 | public function balance(): Attribute 40 | { 41 | return Attribute::make( 42 | get: function() { 43 | return $this->transactions->sum('amount'); 44 | } 45 | ); 46 | } 47 | 48 | public function monthlyBalance(): Attribute 49 | { 50 | return Attribute::make( 51 | get: function() { 52 | return $this->transactions()->whereBetween('happened_at', [now()->startOfMonth(), now()->endOfMonth()])->sum('amount'); 53 | } 54 | ); 55 | } 56 | 57 | public function owner(): BelongsTo 58 | { 59 | return $this->belongsTo(Account::class, 'account_id'); 60 | } 61 | 62 | public function scopeTenant(Builder $query): Builder 63 | { 64 | return $query->where('account_id', optional(Filament::getTenant())->id); 65 | } 66 | 67 | public function transactions(): HasMany 68 | { 69 | return $this->hasMany(Transaction::class); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION="8.1" 2 | 3 | FROM composer:latest as composer 4 | 5 | COPY database/ database/ 6 | COPY tests/ tests/ 7 | COPY composer.json composer.json 8 | COPY composer.lock composer.lock 9 | 10 | RUN composer selfupdate 11 | 12 | # add --no-dev for production 13 | RUN composer install \ 14 | --ignore-platform-reqs \ 15 | --no-interaction \ 16 | --no-plugins \ 17 | --no-scripts \ 18 | --prefer-dist 19 | 20 | COPY --chown=www-data:www-data . /app 21 | 22 | RUN composer dump-autoload --optimize --classmap-authoritative 23 | 24 | FROM php:${PHP_VERSION}-fpm-alpine 25 | 26 | RUN apk update && \ 27 | apk add \ 28 | curl \ 29 | nginx \ 30 | supervisor \ 31 | libintl \ 32 | libjpeg-turbo-dev \ 33 | libpng-dev \ 34 | libxml2-dev \ 35 | libmcrypt-dev \ 36 | libzip-dev \ 37 | libwebp-dev \ 38 | freetype-dev \ 39 | icu-dev \ 40 | zip \ 41 | gd \ 42 | openssl-dev \ 43 | $PHPIZE_DEPS 44 | 45 | RUN docker-php-ext-configure zip && \ 46 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ 47 | && docker-php-ext-install -j$(nproc) gd 48 | 49 | RUN docker-php-ext-install mysqli \ 50 | pdo \ 51 | pdo_mysql \ 52 | exif \ 53 | bcmath \ 54 | zip \ 55 | intl \ 56 | opcache 57 | 58 | RUN docker-php-ext-enable opcache 59 | 60 | #RUN pecl install swoole 61 | #RUN docker-php-ext-enable swoole 62 | 63 | COPY docker/app/php.ini $PHP_INI_DIR/conf.d/ 64 | 65 | WORKDIR /var/www/html 66 | 67 | COPY --from=composer /usr/bin/composer /usr/bin/composer 68 | COPY --from=composer /app/ /var/www/html/ 69 | 70 | COPY docker/nginx/default.conf /etc/nginx/http.d/default.conf 71 | 72 | COPY docker/app/entrypoint.sh /usr/local/bin/ 73 | 74 | COPY docker/app/supervisor.conf /etc/supervisor/conf.d/worker.conf 75 | 76 | RUN chmod +x /usr/local/bin/entrypoint.sh 77 | 78 | RUN chown -R www-data:www-data /var/www/html/storage/* 79 | 80 | RUN chmod -R o+w storage/ 81 | RUN chmod -R o+w bootstrap/cache/ 82 | 83 | ENTRYPOINT ["entrypoint.sh"] 84 | 85 | -------------------------------------------------------------------------------- /app/Models/Account.php: -------------------------------------------------------------------------------- 1 | avatar_url; 32 | } 33 | 34 | public function getCurrentTenantLabel(): string 35 | { 36 | return 'Selected account'; 37 | } 38 | 39 | public function owner(): BelongsTo 40 | { 41 | return $this->belongsTo(User::class); 42 | } 43 | 44 | public function members(): BelongsToMany 45 | { 46 | return $this->belongsToMany(User::class, 'account_member', 'account_id', 'user_id')->using(Member::class); 47 | } 48 | 49 | public function wallets(): HasMany 50 | { 51 | return $this->hasMany(Wallet::class); 52 | } 53 | 54 | public function categories(): HasMany 55 | { 56 | return $this->hasMany(Category::class); 57 | } 58 | 59 | public function transactions(): HasMany 60 | { 61 | return $this->hasMany(Transaction::class); 62 | } 63 | 64 | public function goals(): HasMany 65 | { 66 | return $this->hasMany(Goal::class); 67 | } 68 | 69 | public function budgets(): HasMany 70 | { 71 | return $this->hasMany(Budget::class); 72 | } 73 | 74 | public function debts(): HasMany 75 | { 76 | return $this->hasMany(Debt::class); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /database/migrations/2017_11_15_124230_create_wallets_table.php: -------------------------------------------------------------------------------- 1 | table(), static function (Blueprint $table) { 16 | $table->bigIncrements('id'); 17 | $table->morphs('holder'); 18 | $table->string('name'); 19 | $table->string('slug') 20 | ->index(); 21 | $table->uuid('uuid') 22 | ->unique(); 23 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 24 | $table->string('type')->default(WalletTypeEnum::GENERAL->value); 25 | $table->string('currency_code')->default('USD'); 26 | $table->string('icon')->nullable(); 27 | $table->string('color')->nullable(); 28 | $table->boolean('exclude')->default(false); 29 | $table->unsignedSmallInteger('statement_day_of_month')->nullable(); 30 | $table->unsignedSmallInteger('payment_due_day_of_month')->nullable(); 31 | $table->string('description') 32 | ->nullable(); 33 | $table->json('meta') 34 | ->nullable(); 35 | $table->decimal('balance', 64, 0) 36 | ->default(0); 37 | $table->unsignedSmallInteger('decimal_places') 38 | ->default(2) 39 | ; 40 | $table->softDeletes(); 41 | $table->timestamps(); 42 | 43 | $table->unique(['holder_type', 'holder_id', 'slug']); 44 | }); 45 | } 46 | 47 | public function down(): void 48 | { 49 | Schema::disableForeignKeyConstraints(); 50 | Schema::drop($this->table()); 51 | } 52 | 53 | private function table(): string 54 | { 55 | return (new Wallet())->getTable(); 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /public/js/filament/tables/components/table.js: -------------------------------------------------------------------------------- 1 | function c(){return{collapsedGroups:[],isLoading:!1,selectedRecords:[],shouldCheckUniqueSelection:!0,init:function(){this.$wire.$on("deselectAllTableRecords",()=>this.deselectAllRecords()),this.$watch("selectedRecords",()=>{if(!this.shouldCheckUniqueSelection){this.shouldCheckUniqueSelection=!0;return}this.selectedRecords=[...new Set(this.selectedRecords)],this.shouldCheckUniqueSelection=!1})},mountAction:function(e,s=null){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableAction(e,s)},mountBulkAction:function(e){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableBulkAction(e)},toggleSelectRecordsOnPage:function(){let e=this.getRecordsOnPage();if(this.areRecordsSelected(e)){this.deselectRecords(e);return}this.selectRecords(e)},toggleSelectRecordsInGroup:async function(e){if(this.isLoading=!0,this.areRecordsSelected(this.getRecordsInGroupOnPage(e))){this.deselectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e));return}this.selectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e)),this.isLoading=!1},getRecordsInGroupOnPage:function(e){let s=[];for(let t of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])t.dataset.group===e&&s.push(t.value);return s},getRecordsOnPage:function(){let e=[];for(let s of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])e.push(s.value);return e},selectRecords:function(e){for(let s of e)this.isRecordSelected(s)||this.selectedRecords.push(s)},deselectRecords:function(e){for(let s of e){let t=this.selectedRecords.indexOf(s);t!==-1&&this.selectedRecords.splice(t,1)}},selectAllRecords:async function(){this.isLoading=!0,this.selectedRecords=await this.$wire.getAllSelectableTableRecordKeys(),this.isLoading=!1},deselectAllRecords:function(){this.selectedRecords=[]},isRecordSelected:function(e){return this.selectedRecords.includes(e)},areRecordsSelected:function(e){return e.every(s=>this.isRecordSelected(s))},toggleCollapseGroup:function(e){if(this.isGroupCollapsed(e)){this.collapsedGroups.splice(this.collapsedGroups.indexOf(e),1);return}this.collapsedGroups.push(e)},isGroupCollapsed:function(e){return this.collapsedGroups.includes(e)},resetCollapsedGroups:function(){this.collapsedGroups=[]}}}export{c as default}; 2 | -------------------------------------------------------------------------------- /database/migrations/2018_11_06_222923_create_transactions_table.php: -------------------------------------------------------------------------------- 1 | table(), static function (Blueprint $table) { 18 | $table->bigIncrements('id'); 19 | $table->morphs('payable'); 20 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 21 | $table->foreignIdFor(Category::class)->nullable()->constrained((new Category())->getTable())->cascadeOnDelete(); 22 | $table->foreignIdFor(Wallet::class)->nullable()->constrained((new Wallet())->getTable())->cascadeOnDelete(); 23 | $table->string('type')->comment(implode(',', TransactionTypeEnum::toArray()))->index(); 24 | $table->decimal('amount', 64, 0); 25 | $table->boolean('confirmed'); 26 | $table->text('description')->nullable(); 27 | $table->json('meta') 28 | ->nullable(); 29 | $table->uuid('uuid') 30 | ->unique(); 31 | $table->timestamp('happened_at')->default(now()); 32 | $table->nullableMorphs('reference'); 33 | $table->softDeletes(); 34 | $table->timestamps(); 35 | 36 | $table->index(['payable_type', 'payable_id'], 'payable_type_payable_id_ind'); 37 | $table->index(['payable_type', 'payable_id', 'type'], 'payable_type_ind'); 38 | $table->index(['payable_type', 'payable_id', 'confirmed'], 'payable_confirmed_ind'); 39 | $table->index(['payable_type', 'payable_id', 'type', 'confirmed'], 'payable_type_confirmed_ind'); 40 | }); 41 | } 42 | 43 | public function down(): void 44 | { 45 | Schema::drop($this->table()); 46 | } 47 | 48 | private function table(): string 49 | { 50 | return (new Transaction())->getTable(); 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /resources/views/banner.blade.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /app/Models/Wallet.php: -------------------------------------------------------------------------------- 1 | where('account_id', optional(Filament::getTenant())->id); 45 | } 46 | 47 | public function owner(): BelongsTo 48 | { 49 | return $this->belongsTo(Account::class, 'account_id'); 50 | } 51 | 52 | public function onModelSaving(): void 53 | { 54 | if(filled(auth()->user())) { 55 | $this->holder_type = User::class; 56 | $this->holder_id = auth()->user()->id; 57 | } 58 | $this->meta = array_merge($this->meta ?? [], [ 59 | 'currency' => $this->currency_code, 60 | ]); 61 | } 62 | 63 | public function onModelCreated(): void 64 | { 65 | $amount = $this->meta['initial_balance'] ?? 0; 66 | if($this->type == WalletTypeEnum::CREDIT_CARD->value) { 67 | $amount = $this->meta['total_due'] ?? 0; 68 | if($amount > 0) { 69 | $this->withdraw($amount, ['description' => 'Initial credit card due']); 70 | } 71 | } elseif($amount > 0) { 72 | $this->deposit($amount, ['description' => 'Initial balance']); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /database/migrations/2018_11_07_192923_create_transfers_table.php: -------------------------------------------------------------------------------- 1 | table(), function (Blueprint $table) { 17 | $table->bigIncrements('id'); 18 | $table->foreignIdFor(Account::class)->constrained((new Account())->getTable())->cascadeOnDelete(); 19 | $table->morphs('from'); 20 | $table->morphs('to'); 21 | $table->string('status')->comment(implode(',', TransferStatusEnum::toArray()))->default(TransferStatusEnum::TRANSFER->value); 22 | $table->string('status_last')->comment(implode(',', TransferStatusEnum::toArray()))->nullable(); 23 | 24 | $table->unsignedBigInteger('deposit_id'); 25 | $table->unsignedBigInteger('withdraw_id'); 26 | 27 | $table->decimal('discount', 64, 0) 28 | ->default(0); 29 | 30 | $table->decimal('fee', 64, 0) 31 | ->default(0); 32 | 33 | $table->uuid('uuid') 34 | ->unique(); 35 | $table->text('description')->nullable(); 36 | $table->timestamp('happened_at')->default(now()); 37 | $table->softDeletes(); 38 | $table->timestamps(); 39 | 40 | $table->foreign('deposit_id') 41 | ->references('id') 42 | ->on($this->transactionTable()) 43 | ->onDelete('cascade') 44 | ; 45 | 46 | $table->foreign('withdraw_id') 47 | ->references('id') 48 | ->on($this->transactionTable()) 49 | ->onDelete('cascade') 50 | ; 51 | }); 52 | } 53 | 54 | public function down(): void 55 | { 56 | Schema::drop($this->table()); 57 | } 58 | 59 | private function table(): string 60 | { 61 | return (new Transfer())->getTable(); 62 | } 63 | 64 | private function transactionTable(): string 65 | { 66 | return (new Transaction())->getTable(); 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 41 | 'port' => env('PUSHER_PORT', 443), 42 | 'scheme' => env('PUSHER_SCHEME', 'https'), 43 | 'encrypted' => true, 44 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 45 | ], 46 | 'client_options' => [ 47 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 48 | ], 49 | ], 50 | 51 | 'ably' => [ 52 | 'driver' => 'ably', 53 | 'key' => env('ABLY_KEY'), 54 | ], 55 | 56 | 'redis' => [ 57 | 'driver' => 'redis', 58 | 'connection' => 'default', 59 | ], 60 | 61 | 'log' => [ 62 | 'driver' => 'log', 63 | ], 64 | 65 | 'null' => [ 66 | 'driver' => 'null', 67 | ], 68 | 69 | ], 70 | 71 | ]; 72 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /app/Filament/Widgets/CategoryChart.php: -------------------------------------------------------------------------------- 1 | whereNotNull('category_id') 40 | ->tenant() 41 | ->where('type', TransactionTypeEnum::WITHDRAW->value) 42 | ->whereBetween('happened_at', [now()->subDays(10)->startOfDay(), now()->endOfDay()]) 43 | ->get() 44 | ->groupBy(function ($item) { 45 | return $item->category_id; 46 | }) 47 | ->map(function ($item) { 48 | return $item->sum('amount') * -1; 49 | })->sortDesc()->take(10); 50 | 51 | return [ 52 | 'chart' => [ 53 | 'type' => 'bar', 54 | 'height' => 300, 55 | ], 56 | 'series' => [ 57 | [ 58 | 'name' => 'BasicBarChart', 59 | 'data' => $transactions->values()->toArray(), 60 | ], 61 | ], 62 | 'xaxis' => [ 63 | 'categories' => Category::whereIn('id', $transactions->keys())->pluck('name')->toArray(), 64 | 'labels' => [ 65 | 'style' => [ 66 | 'fontFamily' => 'inherit', 67 | ], 68 | ], 69 | ], 70 | 'yaxis' => [ 71 | 'labels' => [ 72 | 'style' => [ 73 | 'fontFamily' => 'inherit', 74 | ], 75 | ], 76 | ], 77 | 'colors' => ['#f59e0b'], 78 | 'plotOptions' => [ 79 | 'bar' => [ 80 | 'borderRadius' => 3, 81 | 'horizontal' => true, 82 | ], 83 | ], 84 | ]; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's middleware aliases. 50 | * 51 | * Aliases may be used instead of class names to conveniently assign middleware to routes and groups. 52 | * 53 | * @var array 54 | */ 55 | protected $middlewareAliases = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 64 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /config/icon-picker.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'heroicons', 20 | 'fontawesome-solid', 21 | 'lucide-icons', 22 | ], 23 | // example: 24 | // 'sets' => 'heroicons', 25 | // 'sets' => [ 26 | // 'heroicons', 27 | // 'fontawesome-solid', 28 | // ], 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Default Columns 33 | |-------------------------------------------------------------------------- 34 | | 35 | | This is the default value for the columns configuration. It is used by 36 | | every icon picker, when not set explicitly. 37 | | 38 | | Can be either an integer from 1 - 12 or an array of integers 39 | | with breakpoints (default, sm, md, lg, xl, 2xl) as the key. 40 | | 41 | */ 42 | 'columns' => 1, 43 | // example: 44 | // 'columns' => [ 45 | // 'default' => 1, 46 | // 'lg' => 3, 47 | // '2xl' => 5, 48 | // ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | Default Layout 53 | |-------------------------------------------------------------------------- 54 | | 55 | | This is the default value for the layout configuration. It is used by 56 | | every icon picker, when not set explicitly. 57 | | 58 | | FLOATING: The select will behave the same way as the default filament 59 | | select. It will show when selected and hide when clicked outside. 60 | | 61 | | ON_TOP: The select options will always be visible in a catalogue-like 62 | | grid view. 63 | | 64 | */ 65 | 'layout' => \Guava\FilamentIconPicker\Layout::FLOATING, 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Caching 70 | |-------------------------------------------------------------------------- 71 | | 72 | | This section lets you configure the caching option of the plugin. 73 | | 74 | | Since icon packs are often packed with a lots of icons, 75 | | searching through all of them can take quite a lot of time, which is 76 | | why the plugin caches each field with it's configuration and search queries. 77 | | 78 | | This section let's you configure how caching should be done or disable it 79 | | if you wish. 80 | | 81 | */ 82 | 'cache' => [ 83 | 'enabled' => true, 84 | 'duration' => '7 days', 85 | ], 86 | 87 | ]; 88 | -------------------------------------------------------------------------------- /public/css/filament/support/support.css: -------------------------------------------------------------------------------- 1 | .fi-pagination-items,.fi-pagination-overview,.fi-pagination-records-per-page-select:not(.fi-compact){display:none}@supports (container-type:inline-size){.fi-pagination{container-type:inline-size}@container (min-width: 28rem){.fi-pagination-records-per-page-select.fi-compact{display:none}.fi-pagination-records-per-page-select:not(.fi-compact){display:inline}}@container (min-width: 56rem){.fi-pagination:not(.fi-simple)>.fi-pagination-previous-btn{display:none}.fi-pagination-overview{display:inline}.fi-pagination:not(.fi-simple)>.fi-pagination-next-btn{display:none}.fi-pagination-items{display:flex}}}@supports not (container-type:inline-size){@media (min-width:640px){.fi-pagination-records-per-page-select.fi-compact{display:none}.fi-pagination-records-per-page-select:not(.fi-compact){display:inline}}@media (min-width:768px){.fi-pagination:not(.fi-simple)>.fi-pagination-previous-btn{display:none}.fi-pagination-overview{display:inline}.fi-pagination:not(.fi-simple)>.fi-pagination-next-btn{display:none}.fi-pagination-items{display:flex}}}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}.tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.fi-sortable-ghost{opacity:.3} -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The skeleton application for the Laravel framework.", 5 | "keywords": [ 6 | "laravel", 7 | "framework" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^8.1", 12 | "akaunting/laravel-money": "^5.1", 13 | "awcodes/filament-badgeable-column": "^2.0", 14 | "bavix/laravel-wallet": "^10.0", 15 | "blade-ui-kit/blade-icons": "^1.5", 16 | "cviebrock/eloquent-sluggable": "^10.0", 17 | "filament/filament": "^3.0", 18 | "filament/notifications": "^3.0", 19 | "guava/filament-icon-picker": "^2.0", 20 | "guzzlehttp/guzzle": "^7.2", 21 | "jeffgreco13/filament-breezy": "^v2.1.1", 22 | "laravel/framework": "^10.10", 23 | "laravel/helpers": "^1.6", 24 | "laravel/sanctum": "^3.2", 25 | "laravel/tinker": "^2.8", 26 | "leandrocfe/filament-apex-charts": "^3.0", 27 | "mallardduck/blade-lucide-icons": "^1.11", 28 | "rinvex/countries": "^9.0", 29 | "shipu/watchable": "dev-master", 30 | "symfony/polyfill-intl-icu": "^1.27" 31 | }, 32 | "require-dev": { 33 | "barryvdh/laravel-debugbar": "^3.8", 34 | "doctrine/dbal": "^3.6", 35 | "fakerphp/faker": "^1.9.1", 36 | "laravel/pint": "^1.0", 37 | "laravel/sail": "^1.18", 38 | "mockery/mockery": "^1.4.4", 39 | "nunomaduro/collision": "^7.0", 40 | "phpunit/phpunit": "^10.1", 41 | "spatie/laravel-ignition": "^2.0" 42 | }, 43 | "autoload": { 44 | "psr-4": { 45 | "App\\": "app/", 46 | "Database\\Factories\\": "database/factories/", 47 | "Database\\Seeders\\": "database/seeders/" 48 | }, 49 | "files": [ 50 | "app/Support/helpers.php" 51 | ] 52 | }, 53 | "autoload-dev": { 54 | "psr-4": { 55 | "Tests\\": "tests/" 56 | } 57 | }, 58 | "scripts": { 59 | "post-autoload-dump": [ 60 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 61 | "@php artisan package:discover --ansi", 62 | "@php artisan filament:upgrade" 63 | ], 64 | "post-update-cmd": [ 65 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 66 | ], 67 | "post-root-package-install": [ 68 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 69 | ], 70 | "post-create-project-cmd": [ 71 | "@php artisan key:generate --ansi" 72 | ] 73 | }, 74 | "extra": { 75 | "laravel": { 76 | "dont-discover": [] 77 | } 78 | }, 79 | "config": { 80 | "optimize-autoloader": true, 81 | "preferred-install": "dist", 82 | "sort-packages": true, 83 | "allow-plugins": { 84 | "pestphp/pest-plugin": true, 85 | "php-http/discovery": true 86 | } 87 | }, 88 | "minimum-stability": "dev", 89 | "prefer-stable": true 90 | } 91 | -------------------------------------------------------------------------------- /app/Filament/Resources/TransactionResource/Pages/CreateTransaction.php: -------------------------------------------------------------------------------- 1 | value) { 28 | $data['amount'] = $data['amount'] * -1; 29 | try { 30 | $this->validateCreditLimit($data); 31 | } catch (InsufficientFunds $exception) { 32 | Notification::make() 33 | ->danger() 34 | ->title("Insufficient funds") 35 | ->send(); 36 | $this->halt(); 37 | } 38 | } elseif(in_array($type, [TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::PAYMENT->value])) { 39 | $this->createTransferOrPaymentTransaction($data); 40 | $this->sendCreatedNotificationAndRedirect(shouldCreateAnotherInsteadOfRedirecting: false); 41 | $this->halt(); 42 | } 43 | 44 | return $data; 45 | } 46 | 47 | /** 48 | * @throws Halt 49 | */ 50 | public function validateCreditLimit($data): void 51 | { 52 | $wallet = Wallet::findOrFail($data['wallet_id']); 53 | $amount = (double) $wallet->balance + ($data['amount']); 54 | 55 | $amount = $amount / 100; // cents to dollars 56 | 57 | if($wallet->type == WalletTypeEnum::CREDIT_CARD->value) { 58 | $creditLimit = -1 * (double) array_get($wallet->meta, 'credit'); 59 | if($amount < $creditLimit) { 60 | throw new InsufficientFunds('Insufficient funds'); 61 | } 62 | } 63 | } 64 | 65 | public function createTransferOrPaymentTransaction($data): void 66 | { 67 | $fromWallet = Wallet::findOrFail($data['from_wallet_id']); 68 | $toWallet = Wallet::findOrFail($data['to_wallet_id']); 69 | $meta = ['happened_at' => $data['happened_at'] ?? now(), 'type' => $data['type']]; 70 | 71 | if(array_get($data, 'type') == TransactionTypeEnum::PAYMENT->value) { 72 | $meta['payment'] = true; 73 | }elseif (array_get($data, 'type') == TransactionTypeEnum::TRANSFER->value) { 74 | $meta['transfer'] = true; 75 | } 76 | 77 | $transfer = $fromWallet->transfer($toWallet, $data['amount'], new Extra( 78 | deposit: $meta, 79 | withdraw: $meta, 80 | )); 81 | $this->record = $transfer->deposit; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /database/seeders/CategorySeeder.php: -------------------------------------------------------------------------------- 1 | 'Bills', 21 | 'type' => SpendTypeEnum::EXPENSE->value, 22 | 'color' => '#22b3e0', 23 | 'icon' => 'receipt', 24 | ], 25 | [ 26 | 'name' => 'Food', 27 | 'type' => SpendTypeEnum::EXPENSE->value, 28 | 'color' => '#224ce0', 29 | 'icon' => 'lucide-utensils', 30 | ], 31 | [ 32 | 'name' => 'Transport', 33 | 'type' => SpendTypeEnum::EXPENSE->value, 34 | 'color' => '#e07222', 35 | 'icon' => 'lucide-bus', 36 | ], 37 | [ 38 | 'name' => 'Shopping', 39 | 'type' => SpendTypeEnum::EXPENSE->value, 40 | 'color' => '#22a1e0', 41 | 'icon' => 'lucide-shirt', 42 | ], 43 | [ 44 | 'name' => 'Entertainment', 45 | 'type' => SpendTypeEnum::EXPENSE->value, 46 | 'color' => '#e02222', 47 | 'icon' => 'lucide-gamepad-2', 48 | ], 49 | [ 50 | 'name' => 'Health', 51 | 'type' => SpendTypeEnum::EXPENSE->value, 52 | 'color' => '#22e0b3', 53 | 'icon' => 'lucide-stethoscope', 54 | ], 55 | [ 56 | 'name' => 'Education', 57 | 'type' => SpendTypeEnum::EXPENSE->value, 58 | 'color' => '#e0b322', 59 | 'icon' => 'lucide-graduation-cap', 60 | ], 61 | [ 62 | 'name' => 'Gifts', 63 | 'type' => SpendTypeEnum::EXPENSE->value, 64 | 'color' => '#22e0b3', 65 | 'icon' => 'lucide-gift', 66 | ], 67 | [ 68 | 'name' => 'Salary', 69 | 'type' => SpendTypeEnum::INCOME->value, 70 | 'color' => '#e0b322', 71 | 'icon' => 'lucide-banknote', 72 | ], 73 | [ 74 | 'name' => 'Business', 75 | 'type' => SpendTypeEnum::INCOME->value, 76 | 'color' => '#2279e0', 77 | 'icon' => 'lucide-building-2', 78 | ], 79 | [ 80 | 'name' => 'Extra Income', 81 | 'type' => SpendTypeEnum::INCOME->value, 82 | 'color' => '#e0b322', 83 | 'icon' => 'lucide-coins', 84 | ], 85 | ]; 86 | 87 | $accounts = Account::all(); 88 | 89 | foreach ($accounts as $key => $account) { 90 | foreach ($categories as $category) { 91 | $category['account_id'] = $account->id; 92 | Category::create($category); 93 | } 94 | } 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 36 | */ 37 | protected $fillable = [ 38 | 'name', 39 | 'email', 40 | 'password', 41 | 'avatar_url', 42 | 'latest_account_id' 43 | ]; 44 | 45 | /** 46 | * The attributes that should be hidden for serialization. 47 | * 48 | * @var array 49 | */ 50 | protected $hidden = [ 51 | 'password', 52 | 'remember_token', 53 | ]; 54 | 55 | /** 56 | * The attributes that should be cast. 57 | * 58 | * @var array 59 | */ 60 | protected $casts = [ 61 | 'email_verified_at' => 'datetime', 62 | 'password' => 'hashed', 63 | ]; 64 | 65 | public function getFilamentAvatarUrl(): ?string 66 | { 67 | return $this->avatar_url; 68 | } 69 | 70 | public function getTenants(Panel $panel): Collection 71 | { 72 | return $this->ownedAccounts; 73 | } 74 | 75 | public function accounts(): BelongsToMany 76 | { 77 | return $this->belongsToMany(Account::class, 'account_member', 'user_id', 'account_id')->using(Member::class); 78 | } 79 | 80 | public function ownedAccounts(): HasMany 81 | { 82 | return $this->hasMany(Account::class, 'owner_id'); 83 | } 84 | 85 | public function canAccessTenant(Model $tenant): bool 86 | { 87 | return $this->ownedAccounts->contains($tenant); 88 | } 89 | 90 | public function getDefaultTenant(Panel $panel): ?Model 91 | { 92 | return $this->latestAccount; 93 | } 94 | 95 | public function latestAccount(): BelongsTo 96 | { 97 | return $this->belongsTo(Account::class, 'latest_account_id'); 98 | } 99 | 100 | public function canAccessPanel(Panel $panel): bool 101 | { 102 | return true; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/Filament/Resources/GoalResource/Pages/ListGoals.php: -------------------------------------------------------------------------------- 1 | label(__('goals.actions.deposit')) 26 | ->color('danger') 27 | ->icon('lucide-trending-up') 28 | ->form($this->getGoalTransactionFields()) 29 | ->action(function (array $data) { 30 | $this->makeGoalTransaction($data); 31 | }), 32 | Action::make('withdraw') 33 | ->label(__('goals.actions.withdraw')) 34 | ->color('warning') 35 | ->icon('lucide-trending-down') 36 | ->form($this->getGoalTransactionFields('withdraw')) 37 | ->action(function (array $data) { 38 | $this->makeGoalTransaction($data); 39 | }), 40 | Actions\CreateAction::make()->slideOver(), 41 | ]; 42 | } 43 | 44 | public function getGoalTransactionFields($type = 'deposit', $goalId = null): array 45 | { 46 | return [ 47 | Hidden::make('type') 48 | ->default($type), 49 | Hidden::make('goal_id') 50 | ->default($goalId) 51 | ->visible(fn() => !is_null($goalId)), 52 | Select::make('goal_id') 53 | ->label(__('goals.fields.goal')) 54 | ->options(Goal::tenant()->pluck('name', 'id')->toArray()) 55 | ->visible(fn() => is_null($goalId)) 56 | ->searchable() 57 | ->required(), 58 | Select::make('wallet_id') 59 | ->label(__('goals.fields.from_wallet')) 60 | ->options(Wallet::tenant()->pluck('name', 'id')->toArray()) 61 | ->searchable() 62 | ->required(), 63 | TextInput::make('amount') 64 | ->label(__('goals.fields.amount')) 65 | ->numeric() 66 | ->required(), 67 | ]; 68 | } 69 | 70 | public function makeGoalTransaction($data): void 71 | { 72 | try { 73 | $wallet = Wallet::findOrFail($data['wallet_id']); 74 | $amount = (double) $data['amount']; 75 | $method = 'withdraw'; 76 | if($data['type'] == 'withdraw') { 77 | $method = 'deposit'; 78 | } 79 | 80 | $wallet->{$method}($amount * 100, [ 81 | 'reference_type' => Goal::class, 82 | 'reference_id' => $data['goal_id'], 83 | ]); 84 | 85 | Notification::make() 86 | ->title('Saved successfully') 87 | ->success() 88 | ->send(); 89 | } catch (\Exception $e) { 90 | Notification::make() 91 | ->title($e->getMessage()) 92 | ->danger() 93 | ->send(); 94 | } 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/Providers/Filament/AdminPanelProvider.php: -------------------------------------------------------------------------------- 1 | default() 33 | ->id('hub') 34 | ->login(Login::class) 35 | ->colors([ 36 | 'primary' => Color::Sky, 37 | ]) 38 | ->sidebarWidth('17rem') 39 | ->favicon(asset('brands/dinero-favicon.png')) 40 | ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') 41 | ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') 42 | ->pages([ 43 | Dashboard::class, 44 | ]) 45 | ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') 46 | ->widgets([ 47 | // Widgets\AccountWidget::class, 48 | // Widgets\FilamentInfoWidget::class, 49 | ]) 50 | ->middleware([ 51 | EncryptCookies::class, 52 | AddQueuedCookiesToResponse::class, 53 | StartSession::class, 54 | AuthenticateSession::class, 55 | ShareErrorsFromSession::class, 56 | VerifyCsrfToken::class, 57 | SubstituteBindings::class, 58 | DisableBladeIconComponents::class, 59 | DispatchServingFilamentEvent::class, 60 | IdentifyTenant::class, 61 | ]) 62 | ->authMiddleware([ 63 | Authenticate::class, 64 | ]) 65 | ->profile() 66 | ->sidebarCollapsibleOnDesktop() 67 | ->plugins( 68 | [ 69 | FilamentApexChartsPlugin::make(), 70 | BreezyCore::make() 71 | ->myProfile(hasAvatars: true) 72 | ->enableTwoFactorAuthentication() 73 | ] 74 | ) 75 | ->tenant(model: Account::class, slugAttribute: 'id', ownershipRelationship: 'owner') 76 | ->tenantRegistration(RegisterAccount::class) 77 | ->tenantProfile(EditAccountProfile::class) 78 | ->renderHook( 'panels::content.start', function () { 79 | if(config('app.demo')) { 80 | return view('banner'); 81 | } 82 | return null; 83 | }) 84 | ->databaseNotifications() 85 | ->databaseNotificationsPolling('30s'); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | 'lock_path' => storage_path('framework/cache/data'), 56 | ], 57 | 58 | 'memcached' => [ 59 | 'driver' => 'memcached', 60 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 61 | 'sasl' => [ 62 | env('MEMCACHED_USERNAME'), 63 | env('MEMCACHED_PASSWORD'), 64 | ], 65 | 'options' => [ 66 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 67 | ], 68 | 'servers' => [ 69 | [ 70 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 71 | 'port' => env('MEMCACHED_PORT', 11211), 72 | 'weight' => 100, 73 | ], 74 | ], 75 | ], 76 | 77 | 'redis' => [ 78 | 'driver' => 'redis', 79 | 'connection' => 'cache', 80 | 'lock_connection' => 'default', 81 | ], 82 | 83 | 'dynamodb' => [ 84 | 'driver' => 'dynamodb', 85 | 'key' => env('AWS_ACCESS_KEY_ID'), 86 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 87 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 88 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 89 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 90 | ], 91 | 92 | 'octane' => [ 93 | 'driver' => 'octane', 94 | ], 95 | 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Cache Key Prefix 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 104 | | stores there might be other applications using the same cache. For 105 | | that reason, you may prefix every cache key to avoid collisions. 106 | | 107 | */ 108 | 109 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /app/Models/Transaction.php: -------------------------------------------------------------------------------- 1 | 'int', 41 | 'confirmed' => 'bool', 42 | 'meta' => 'array', 43 | 'happened_at' => 'datetime', 44 | ]; 45 | 46 | public function owner(): BelongsTo 47 | { 48 | return $this->belongsTo(Account::class, 'account_id'); 49 | } 50 | 51 | public function category(): BelongsTo 52 | { 53 | return $this->belongsTo(Category::class); 54 | } 55 | 56 | public function scopeTenant(Builder $query): Builder 57 | { 58 | return $query->where('account_id', optional(Filament::getTenant())->id); 59 | } 60 | 61 | public function wallet(): BelongsTo 62 | { 63 | $filamentTenantId = optional(Filament::getTenant())->id; 64 | $relationShip = $this->belongsTo(Wallet::class); 65 | 66 | if(!blank($filamentTenantId)) { 67 | return $relationShip->where('account_id', $filamentTenantId); 68 | } 69 | 70 | return $relationShip; 71 | } 72 | 73 | public function onModelCreating(): void 74 | { 75 | if(blank($this->payable_id) && filled($user = auth()->user())) { 76 | $this->payable_type = User::class; 77 | $this->payable_id = $user->id; 78 | } 79 | 80 | if(blank($this->uuid)) { 81 | $this->uuid = app(UuidFactoryServiceInterface::class)->uuid4(); 82 | } 83 | 84 | $this->type = match (optional($this->category)->type) { 85 | SpendTypeEnum::EXPENSE->value => TransactionTypeEnum::WITHDRAW->value, 86 | SpendTypeEnum::INCOME->value => TransactionTypeEnum::DEPOSIT->value, 87 | default => $this->type, 88 | }; 89 | } 90 | 91 | public function onModelSaving(): void 92 | { 93 | if(in_array($this->type, [TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::PAYMENT->value])) { 94 | $this->type = $this->getOriginal('type'); 95 | } 96 | $this->meta = array_merge(($this->getOriginal('meta') ?? []), $this->meta ?? []); 97 | } 98 | 99 | public function isTransferTransaction(): Attribute 100 | { 101 | return Attribute::make( 102 | get: function() { 103 | return array_get($this->meta, 'transfer', false) ?? false; 104 | } 105 | ); 106 | } 107 | 108 | public function isPaymentTransaction(): Attribute 109 | { 110 | return Attribute::make( 111 | get: function() { 112 | return array_get($this->meta, 'payment', false) ?? false; 113 | } 114 | ); 115 | } 116 | 117 | public function onModelSaved(): void 118 | { 119 | optional($this->wallet)->refreshBalance(); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Job Batching 79 | |-------------------------------------------------------------------------- 80 | | 81 | | The following options configure the database and table that store job 82 | | batching information. These options can be updated to any database 83 | | connection and table which has been defined by your application. 84 | | 85 | */ 86 | 87 | 'batching' => [ 88 | 'database' => env('DB_CONNECTION', 'mysql'), 89 | 'table' => 'job_batches', 90 | ], 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | Failed Queue Jobs 95 | |-------------------------------------------------------------------------- 96 | | 97 | | These options configure the behavior of failed queue job logging so you 98 | | can control which database and table are used to store the jobs that 99 | | have failed. You may change them to any database / table you wish. 100 | | 101 | */ 102 | 103 | 'failed' => [ 104 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 105 | 'database' => env('DB_CONNECTION', 'mysql'), 106 | 'table' => 'failed_jobs', 107 | ], 108 | 109 | ]; 110 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'url' => env('MAIL_URL'), 40 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 41 | 'port' => env('MAIL_PORT', 587), 42 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 43 | 'username' => env('MAIL_USERNAME'), 44 | 'password' => env('MAIL_PASSWORD'), 45 | 'timeout' => null, 46 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 47 | ], 48 | 49 | 'ses' => [ 50 | 'transport' => 'ses', 51 | ], 52 | 53 | 'mailgun' => [ 54 | 'transport' => 'mailgun', 55 | // 'client' => [ 56 | // 'timeout' => 5, 57 | // ], 58 | ], 59 | 60 | 'postmark' => [ 61 | 'transport' => 'postmark', 62 | // 'client' => [ 63 | // 'timeout' => 5, 64 | // ], 65 | ], 66 | 67 | 'sendmail' => [ 68 | 'transport' => 'sendmail', 69 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 70 | ], 71 | 72 | 'log' => [ 73 | 'transport' => 'log', 74 | 'channel' => env('MAIL_LOG_CHANNEL'), 75 | ], 76 | 77 | 'array' => [ 78 | 'transport' => 'array', 79 | ], 80 | 81 | 'failover' => [ 82 | 'transport' => 'failover', 83 | 'mailers' => [ 84 | 'smtp', 85 | 'log', 86 | ], 87 | ], 88 | ], 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Global "From" Address 93 | |-------------------------------------------------------------------------- 94 | | 95 | | You may wish for all e-mails sent by your application to be sent from 96 | | the same address. Here, you may specify a name and address that is 97 | | used globally for all e-mails that are sent by your application. 98 | | 99 | */ 100 | 101 | 'from' => [ 102 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 103 | 'name' => env('MAIL_FROM_NAME', 'Example'), 104 | ], 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Markdown Mail Settings 109 | |-------------------------------------------------------------------------- 110 | | 111 | | If you are using Markdown based email rendering, you may configure your 112 | | theme and component paths here, allowing you to customize the design 113 | | of the emails. Or, you may simply stick with the Laravel defaults! 114 | | 115 | */ 116 | 117 | 'markdown' => [ 118 | 'theme' => 'default', 119 | 120 | 'paths' => [ 121 | resource_path('views/vendor/mail'), 122 | ], 123 | ], 124 | 125 | ]; 126 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => App\Models\User::class, 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 82 | | 83 | | The expiry time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | | The throttle setting is the number of seconds a user must wait before 88 | | generating more password reset tokens. This prevents the user from 89 | | quickly generating a very large amount of password reset tokens. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => 'password_reset_tokens', 97 | 'expire' => 60, 98 | 'throttle' => 60, 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Password Confirmation Timeout 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Here you may define the amount of seconds before a password confirmation 108 | | times out and the user is prompted to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => 10800, 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Dinero 4 | 5 |

6 | 7 |
8 | 9 |

:rocket: Multi Account Money Tracker :sparkles: Dinero

10 | 11 |

12 | version project 13 | stack php 14 | stack laravel 15 | stack Filament 16 | stack Tailwind 17 | 18 | GPLv3 License 19 | 20 |

21 | 22 | ## Dinero 23 | Dinero is a multi account money tracker. It is a simple application that allows you to track your money in multiple accounts and categories. It is written in PHP (Laravel Framework) and Filament v3. 24 | 25 | ## Features 26 | - Multi Account (Tenants) 27 | - Multi Currency 28 | - Wallets 29 | - Categories 30 | - Budgets 31 | - Goals 32 | - Debts 33 | - Transactions 34 | - Reports 35 | 36 | ## Installation 37 | 1. Clone the repository 38 | 39 | ```ssh 40 | git clone https://github.com/Shipu/dinero.git 41 | ``` 42 | 43 | 3. Switch to the repo folder 44 | 45 | ``` 46 | cd dinero 47 | ``` 48 | 49 | 2. Install all the dependencies using composer 50 | 51 | ```ssh 52 | composer install 53 | ``` 54 | 55 | 3. Copy the example env file and make the required configuration changes in the .env file 56 | 57 | ```ssh 58 | cp .env.example .env 59 | ``` 60 | 61 | 4. Generate a new application key 62 | 63 | ```ssh 64 | php artisan key:generate 65 | ``` 66 | 67 | 5. Run the database migrations with seeder (Set the database connection in .env before migrating) 68 | 69 | ```ssh 70 | php artisan migrate --seed 71 | ``` 72 | 73 | 6. Run the application 74 | 75 | ```ssh 76 | php artisan serve 77 | ``` 78 | 79 | 7. Browse the application 80 | 81 | > Url: [http://localhost:8000/](http://localhost:8000/) 82 | 83 | ![img.png](img.png) 84 | 85 | 8. Login with the following credentials: 86 | - Email: `demo@dinero.app` 87 | - Password: `12345678` 88 | 89 | ## NativePHP 90 | for the NativePHP version, please check the [nativephp branch](https://github.com/shipu/dinero/tree/native-php) 91 | ```ssh 92 | git checkout native-php 93 | ``` 94 | 95 | ## Demo 96 | > Url: [http://dinero.bridgex.live](http://dinero.bridgex.live) 97 | 98 | ## Screenshots 99 | ![Dashboard](screenshots/dinero-dashboard.png) 100 | ![Wallets](screenshots/dinero-wallets.png) 101 | ![Categories](screenshots/dinero-categories.png) 102 | ![Budgets](screenshots/dinero-budgets.png) 103 | ![Goals](screenshots/dinero-goals.png) 104 | ![Debts](screenshots/dinero-debts.png) 105 | ![Transactions](screenshots/dinero-transactions.png) 106 | ![Accounts](screenshots/dinero-tenants.png) 107 | ![MyProfile](screenshots/dinero-my-profile.png) 108 | 109 | ### :sparkles: Contributors 110 | 111 | 112 | 115 | 118 | 121 | 124 | 125 |
113 | 114 |
Shipu Ahamed
116 | 117 |
Md. Jahidul Islam
119 | 120 |
Alade YESSOUFOU
122 | 123 |
Rafael Blum
126 | 127 | > No one is so wise that they don't have something to learn, nor so foolish that they don't have something to teach. `Blaise Pascal`. 128 | --------------------------------------------------------------------------------