PHP code example of stboris / laravel-croatia-toolkit

1. Go to this page and download the library: Download stboris/laravel-croatia-toolkit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stboris / laravel-croatia-toolkit example snippets


use Stboris\LaravelCroatiaToolkit\Oib\Oib;

Oib::isValid('69435151530'); // true

use Stboris\LaravelCroatiaToolkit\Oib\Rules\ValidOib;

$request->validate([
    'oib' => ['

use Stboris\LaravelCroatiaToolkit\Oib\SudskiRegistarClient;

$company = app(SudskiRegistarClient::class)->lookup('69435151530');

$company->name;
$company->address;
$company->active;

use Filament\Schemas\Components\Utilities\Get;
use Filament\Forms\Components\TextInput;
use Stboris\LaravelCroatiaToolkit\Oib\Filament\OibField;

OibField::make('oib')
    ->autofill(name: 'company_name', address: 'address'),

TextInput::make('company_name')
    ->disabled(fn (Get $get) => $get('oib_locked')),

TextInput::make('address')
    ->disabled(fn (Get $get) => $get('oib_locked')),

use Stboris\LaravelCroatiaToolkit\Hnb\ExchangeRateClient;

$client = new ExchangeRateClient;

$client->rate('USD');           // today's USD rate, or null
$client->rate('USD', '2026-01-15'); // a specific date
$client->list();                // every currency for today

use Stboris\LaravelCroatiaToolkit\Iban\Iban;

Iban::isValid('HR1523600001234567891');          // true - any valid IBAN
Iban::isValidCroatian('HR1523600001234567891');  // true - Croatian shape + checksum

use Stboris\LaravelCroatiaToolkit\Iban\Rules\ValidIban;

$request->validate([
    'iban' => ['

app()->setLocale('hr');
// "Polje oib nije ispravan OIB."
bash
php artisan vendor:publish --tag="croatia-toolkit-translations"