PHPackages                             netcore/module-invoice - 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. netcore/module-invoice

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

netcore/module-invoice
======================

Module for generating invoices.

v1.2.4(8y ago)1405MITPHP &gt;=7.0

Since Nov 27Compare

[ Source](https://github.com/netcore/module-invoice)[ Packagist](https://packagist.org/packages/netcore/module-invoice)[ Docs](http://netcore.lv)[ RSS](/packages/netcore-module-invoice/feed)WikiDiscussions Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (25)Used By (0)

Module for creating invoices
----------------------------

[](#module-for-creating-invoices)

This module was made for easy invoices creating.

Features
--------

[](#features)

- Translatable invoice items
- Invoice can be attached to user, order or any other related stuff
- Custom PDF templates

Pre-installation
----------------

[](#pre-installation)

This module is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:

1.
2.
3.

### Installation

[](#installation)

1. Require this package using composer

```
    composer require netcore/module-invoice
```

2. Publish assets/configuration/migrations

```
    php artisan module:publish Invoice
    php artisan module:publish-config Invoice
    php artisan module:publish-migration Invoice
```

3. Important - Configure relations before migrating

```
    edit config/netcore/module-invoice.php file to enable/disable used relations

```

4. Run the migrations and seeder

```
    php artisan migrate
    php artisan module:seed Invoice
```

### Configuration

[](#configuration)

- Configuration file is available at config/netcore/module-invoice.php

#### Relations

[](#relations)

- Relations will be loaded from config

```
    return [
        'relations' => [
            [
                'name'       => 'user', // relation name
                'type'       => 'belongsTo', // relation type
                'foreignKey' => 'user_id', // foreign key (user_id in invoices table in this case)
                'ownerKey'   => 'id', // owner key (id in related table in this case)
                'enabled'    => false, // is relation enabled? (it should be enable when migrating)
                'class'      => \App\User::class, // related model class

                // Datatable colum config
                'table' => [
                    'show' => true, // Show this column?
                    'name' => 'User', // Column name?

                    'searchable' => true, // Is column searchable?
                    'sortable'   => true, // Is column sortable?
                    'd_data'     => 'user', // Datatables data param
                    'd_name'     => 'user.first_name', // Datatables SQL field param
                    'modifier'   => 'fullName', // Accessor in model to format display format
                ],
            ],
        ...
    ];
```

#### User relation

[](#user-relation)

- To use -&gt;forUser() method, you should implement getInvoiceReceiverData() method in your User model

```
    /**
     * Get user data for invoices.
     *
     * @return array
     */
    public function getInvoiceReceiverData(): array
    {
        return [
            'first_name' => $this->first_name,
            'last_name'  => $this->last_name,
            'email'      => $this->email,
            'phone'      => $this->phone,
        ];
    }
```

### Creating invoice

[](#creating-invoice)

- To create invoice, you can use invoice() helper method

```
    $user = auth()->user();
    $items = [
        [
            'price' => 10.99,
            'name'  => 'Test item #1' // Name is equal for all languages
        ],
        [
            'price' => 25.65,
            // Name is different for each language
            'translations' => [
                'en' => ['name' => 'First product.'],
                'ru' => ['name' => 'Первый товар..'],
                'lv' => ['name' => 'Pirmā prece.'],
            ],
        ]
    ];

    $invoice = invoice()
        ->setItems($items)
        ->setPaymentDetails('VISA ending XXXX')

        ->forUser($user) // optional - set associated user (user relation should be enabled and configured)
        ->setInvoiceNr('MY123') // optional - set custom invoice nr.
        ->setVat(21) // optional - overrides vat specified in config
        ->setSender([ 'name' => 'My awesome company', ... ]) // optional - overrides sender data specified in config
        ->setReceiver([ 'first_name' => ..., 'last_name' => ... ]) // optional - overrides receiver data
        ->mergeReceiver([ 'some_additional_field' => ... ]) // optional - use if you need to add some extra receiver data

        ->make(); // build eveything up and returns Invoice instance
```

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 63.8% 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

Every ~10 days

Recently: every ~3 days

Total

23

Last Release

2957d ago

Major Versions

0.1.x-dev → v1.0.02017-12-14

### Community

Maintainers

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

---

Top Contributors

[![NViktors](https://avatars.githubusercontent.com/u/26169825?v=4)](https://github.com/NViktors "NViktors (37 commits)")[![gstvr](https://avatars.githubusercontent.com/u/13051632?v=4)](https://github.com/gstvr "gstvr (16 commits)")[![dmitrijsmihailovs](https://avatars.githubusercontent.com/u/6555569?v=4)](https://github.com/dmitrijsmihailovs "dmitrijsmihailovs (4 commits)")[![danielsGrietins](https://avatars.githubusercontent.com/u/24427373?v=4)](https://github.com/danielsGrietins "danielsGrietins (1 commits)")

### Embed Badge

![Health badge](/badges/netcore-module-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/netcore-module-invoice/health.svg)](https://phpackages.com/packages/netcore-module-invoice)
```

###  Alternatives

[endroid/pdf

Endroid PDF

3546.6k](/packages/endroid-pdf)[luketowers/oc-snappypdf-plugin

SnappyPDF integration for OctoberCMS

121.1k](/packages/luketowers-oc-snappypdf-plugin)[rafwell/laravel-simplegrid

A simple component for generating powerful grids with Laravel.

363.0k](/packages/rafwell-laravel-simplegrid)

PHPackages © 2026

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