PHPackages                             dgtlinf/payslip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. dgtlinf/payslip

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

dgtlinf/payslip
===============

Generate professional PDF payslips using salary data from dgtlinf/salary-calculator.

v1.0.0(7mo ago)05MITBladePHP ^8.2

Since Oct 6Pushed 7mo agoCompare

[ Source](https://github.com/dgtlinf/payslip)[ Packagist](https://packagist.org/packages/dgtlinf/payslip)[ RSS](/packages/dgtlinf-payslip/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

📄 Dgtlinf Payslip
=================

[](#-dgtlinf-payslip)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0d3d37b9c872db1210391310d02e3acace180d38e75c6ff3fdcf6649d5abd7d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6467746c696e662f706179736c69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dgtlinf/payslip)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

**Professional Laravel package for generating multilingual PDF payslips.**
Built on top of [`dgtlinf/salary-calculator`](https://github.com/dgtlinf/salary-calculator), this package provides an elegant way to render, stream, or download payslips directly from salary calculator data arrays.

---

🚀 Features
----------

[](#-features)

- 🇷🇸 Country-specific providers (currently: Serbia)
- 🧾 PDF generation via [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf)
- 🌍 Multilingual templates (English &amp; Serbian)
- ⚙️ Stream, download, or preview as HTML
- 🧩 Simple integration with `dgtlinf/salary-calculator`
- 🎨 Easily extendable with custom providers and templates

---

📦 Installation
--------------

[](#-installation)

```
composer require dgtlinf/payslip
```

This will also install dependencies like `dgtlinf/salary-calculator` and `barryvdh/laravel-dompdf`.

---

🧩 Configuration
---------------

[](#-configuration)

Publish the configuration and templates if you want to customize them:

```
php artisan vendor:publish --provider="Dgtlinf\Payslip\PayslipServiceProvider"
```

This will publish:

- `config/payslip.php`
- Blade templates under `resources/views/vendor/payslip/`
- Translations under `lang/vendor/payslip/`

---

⚙️ Usage Example
----------------

[](#️-usage-example)

A typical usage example integrating with **dgtlinf/salary-calculator**:

```
use Dgtlinf\SalaryCalculator\Facades\SalaryCalculator;
use Dgtlinf\Payslip\Facades\Payslip;

$months = [
    ['date' => '2025-01-01', 'gross' => 420000],
    ['date' => '2025-02-01', 'gross' => 410000],
    ['date' => '2025-03-01', 'gross' => 435000],
];

$rate = \Dgtlinf\SalaryCalculator\Facades\AverageHourlyRate::calculate($months, 'RS');

$employee = new \Dgtlinf\SalaryCalculator\Models\EmployeeProfile(
    firstName: 'Milan',
    lastName: 'Jovanović',
    address: 'Kralja Petra 10, Beograd',
    idNumber: '0101990123456',
    bankAccount: '160-123456789-01',
    position: 'Software Engineer',
);

$employer = new \Dgtlinf\SalaryCalculator\Models\EmployerProfile(
    name: 'Digital Infinity DOO',
    taxId: '110217311',
    registrationNumber: '21318507',
    address: 'Bulevar Kralja Petra I 89, Novi Sad',
    bankName: 'Raiffeisen Bank',
    bankAccount: '265-0001234567890-00'
);

$context = new \Dgtlinf\SalaryCalculator\Models\SalaryContext(
    2025,
    9,
    'RS',
    vacationDays: 0,
    sickDays: 0,
    sickLeaveFullPay: false,
    yearsInService: 8,
    avgHourlyRateLast12Months: null,
    employee: $employee,
    employer: $employer
);

// Create a calculator instance
$calc = SalaryCalculator::for($context);

// Generate a payslip from net salary
$result = $calc->fromNet(80000);

// Render as HTML (useful for previews)
return Payslip::for($result)->toHtml();

// Or download as PDF
return Payslip::for($result)->download();

// Or stream directly to browser
return Payslip::for($result)->locale('en')->setPaymentDate(now())->stream();
```

---

⚙️ Config Overview
------------------

[](#️-config-overview)

`config/payslip.php`

```
return [
    'default_country' => 'RS',
    'providers' => [
        'RS' => \Dgtlinf\Payslip\Providers\RS\RSPayslipProvider::class,
    ],
    'default_template' => 'default',
    'filename_format' => '{slug}_{year}_{month}_payslip.pdf',
];
```

---

🧩 How It Works
--------------

[](#-how-it-works)

1. **Payslip::for($salaryData)** — accepts a salary result array from `SalaryCalculator`
2. **locale('en'|'sr')** — sets the output language
3. **setPaymentDate(Carbon $date)** — defines the payment date shown on the slip
4. **toHtml() / download() / stream()** — output options

All salary data is taken directly from the SalaryCalculator array — no additional DTOs or models are required.

---

🧠 Extending
-----------

[](#-extending)

To add a new country provider, extend the `BasePayslipProvider` class and register it in the config:

```
'providers' => [
    'DE' => \App\Payslip\Providers\GermanyPayslipProvider::class,
]
```

Then place your template under:

```
resources/views/vendor/payslip/DE/default.blade.php

```

and translations under:

```
lang/vendor/payslip/de/{locale}/payslip.php

```

---

📂 Directory Structure
---------------------

[](#-directory-structure)

```
src/
├── PayslipServiceProvider.php
├── PayslipGenerator.php
├── Facades/Payslip.php
├── Providers/
│   ├── BasePayslipProvider.php
│   └── RS/RSPayslipProvider.php
└── resources/
    ├── views/RS/default.blade.php
    └── lang/rs/{en,sr}/payslip.php

```

---

🏷 License
---------

[](#-license)

This package is open-sourced under the **MIT License**.

---

🧑‍💻 Author
----------

[](#‍-author)

**Digital Infinity d.o.o. Novi Sad**
Bulevar Kralja Petra I 89, 21000 Novi Sad, Serbia
[www.digitalinfinity.rs](https://www.digitalinfinity.rs)

---

© 2025 Digital Infinity. All rights reserved.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance68

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc897661efd3f9b1d0b6cee6fa6eb2f5535819e0c2e0a0adab66b4d6002133be?d=identicon)[gorankrgovic](/maintainers/gorankrgovic)

---

Top Contributors

[![gorankrgovic](https://avatars.githubusercontent.com/u/12137730?v=4)](https://github.com/gorankrgovic "gorankrgovic (2 commits)")

---

Tags

laravelsalarypayslip

### Embed Badge

![Health badge](/badges/dgtlinf-payslip/health.svg)

```
[![Health](https://phpackages.com/badges/dgtlinf-payslip/health.svg)](https://phpackages.com/packages/dgtlinf-payslip)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M709](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M274](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[spatie/laravel-pdf

Create PDFs in Laravel apps

9963.4M11](/packages/spatie-laravel-pdf)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
