Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

German Central Bank Bundle Laravel Package

chrko/german-central-bank-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require chrko/german-central-bank-bundle
    

    Add to config/app.php under providers:

    Chrko\GermanCentralBankBundle\GermanCentralBankServiceProvider::class,
    
  2. Publish Config

    php artisan vendor:publish --provider="Chrko\GermanCentralBankBundle\GermanCentralBankServiceProvider"
    

    Configure config/german-central-bank.php with your database connection and table names.

  3. First Use Case Run the import command to fetch and store the latest bank data:

    php artisan german-central-bank:import
    

    Verify data in the bank_numbers table (default).


Implementation Patterns

Workflows

  1. Scheduled Imports Add to app/Console/Kernel.php:

    $schedule->command('german-central-bank:import')->dailyAt('03:00');
    
  2. Querying Bank Data Use the BankNumber facade or service:

    use Chrko\GermanCentralBankBundle\Facades\BankNumber;
    
    $bank = BankNumber::findByBic('DEUTDEBBXXX');
    $banks = BankNumber::where('city', 'Berlin')->get();
    
  3. Custom Models Extend the default BankNumber model:

    namespace App\Models;
    
    use Chrko\GermanCentralBankBundle\Models\BankNumber as BaseBankNumber;
    
    class BankNumber extends BaseBankNumber {
        public function accounts() {
            return $this->hasMany(Account::class);
        }
    }
    
  4. Validation Validate bank data in forms:

    use Chrko\GermanCentralBankBundle\Rules\ValidBankNumber;
    
    $request->validate([
        'bank_bic' => ['required', new ValidBankNumber],
    ]);
    

Gotchas and Tips

Pitfalls

  1. Large Dataset The bank file (~100MB) may cause memory issues. Use --chunk flag:

    php artisan german-central-bank:import --chunk=1000
    
  2. Database Schema Ensure your bank_numbers table matches the bundle’s migrations. Run:

    php artisan migrate
    

    if needed.

  3. Rate Limiting The central bank’s API may block requests if called too frequently. Cache results:

    Cache::remember('bank_numbers', now()->addDays(7), function() {
        return BankNumber::all();
    });
    

Tips

  1. Custom Fields Add computed properties to the model:

    public function getFullNameAttribute() {
        return "{$this->bank_name} ({$this->bank_code})";
    }
    
  2. Testing Mock the service for unit tests:

    $this->app->instance(
        \Chrko\GermanCentralBankBundle\GermanCentralBank::class,
        Mockery::mock()
    );
    
  3. Logging Enable verbose output for debugging:

    php artisan german-central-bank:import --verbose
    
  4. Extensions Override the importer for custom logic:

    namespace App\Services;
    
    use Chrko\GermanCentralBankBundle\Services\BankImporter;
    
    class CustomBankImporter extends BankImporter {
        protected function transformRow(array $row) {
            // Custom logic
            return parent::transformRow($row);
        }
    }
    

    Bind it in AppServiceProvider:

    $this->app->bind(
        \Chrko\GermanCentralBankBundle\Contracts\BankImporter::class,
        App\Services\CustomBankImporter::class
    );
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui