{"id":43725679,"url":"https://github.com/netcore/module-invoice","last_synced_at":"2026-02-05T09:03:34.663Z","repository":{"id":57025460,"uuid":"109692556","full_name":"netcore/module-invoice","owner":"netcore","description":"Module for creating invoices.","archived":false,"fork":false,"pushed_at":"2018-07-11T23:57:43.000Z","size":808,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-21T02:21:56.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netcore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-06T12:30:07.000Z","updated_at":"2018-08-24T18:08:38.000Z","dependencies_parsed_at":"2022-08-23T13:51:06.199Z","dependency_job_id":null,"html_url":"https://github.com/netcore/module-invoice","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/netcore/module-invoice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-invoice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-invoice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-invoice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-invoice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netcore","download_url":"https://codeload.github.com/netcore/module-invoice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-invoice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29117916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-05T09:03:32.395Z","updated_at":"2026-02-05T09:03:34.658Z","avatar_url":"https://github.com/netcore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Module for creating invoices\nThis module was made for easy invoices creating.\n\n## Features\n\n- Translatable invoice items\n- Invoice can be attached to user, order or any other related stuff\n- Custom PDF templates\n\n## Pre-installation\n\nThis module is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:\n\n1. https://github.com/netcore/netcore\n2. https://github.com/netcore/module-admin\n3. https://github.com/netcore/module-translate\n\n### Installation\n\n 1. Require this package using composer\n```bash\n    composer require netcore/module-invoice\n```\n\n 2. Publish assets/configuration/migrations\n```bash\n    php artisan module:publish Invoice\n    php artisan module:publish-config Invoice\n    php artisan module:publish-migration Invoice\n```\n\n 3. Important - Configure relations before migrating\n```text\n    edit config/netcore/module-invoice.php file to enable/disable used relations\n```\n\n 4. Run the migrations and seeder\n```bash \n    php artisan migrate\n    php artisan module:seed Invoice\n```\n\n### Configuration\n\n - Configuration file is available at config/netcore/module-invoice.php\n\n#### Relations\n\n- Relations will be loaded from config\n```php\n    return [\n        'relations' =\u003e [\n            [\n                'name'       =\u003e 'user', // relation name\n                'type'       =\u003e 'belongsTo', // relation type\n                'foreignKey' =\u003e 'user_id', // foreign key (user_id in invoices table in this case)\n                'ownerKey'   =\u003e 'id', // owner key (id in related table in this case)\n                'enabled'    =\u003e false, // is relation enabled? (it should be enable when migrating)\n                'class'      =\u003e \\App\\User::class, // related model class\n    \n                // Datatable colum config\n                'table' =\u003e [\n                    'show' =\u003e true, // Show this column?\n                    'name' =\u003e 'User', // Column name?\n    \n                    'searchable' =\u003e true, // Is column searchable?\n                    'sortable'   =\u003e true, // Is column sortable?\n                    'd_data'     =\u003e 'user', // Datatables data param\n                    'd_name'     =\u003e 'user.first_name', // Datatables SQL field param\n                    'modifier'   =\u003e 'fullName', // Accessor in model to format display format\n                ],\n            ],\n        ...\n    ];\n```\n\n#### User relation\n\n- To use -\u003eforUser() method, you should implement getInvoiceReceiverData() method in your User model\n```php \n    /**\n     * Get user data for invoices.\n     *\n     * @return array\n     */\n    public function getInvoiceReceiverData(): array\n    {\n        return [\n            'first_name' =\u003e $this-\u003efirst_name,\n            'last_name'  =\u003e $this-\u003elast_name,\n            'email'      =\u003e $this-\u003eemail,\n            'phone'      =\u003e $this-\u003ephone,\n        ];\n    }\n```\n\n### Creating invoice\n\n- To create invoice, you can use invoice() helper method\n```php \n    $user = auth()-\u003euser();\n    $items = [\n        [\n            'price' =\u003e 10.99,\n            'name'  =\u003e 'Test item #1' // Name is equal for all languages \n        ],\n        [\n            'price' =\u003e 25.65,\n            // Name is different for each language\n            'translations' =\u003e [\n                'en' =\u003e ['name' =\u003e 'First product.'],                    \n                'ru' =\u003e ['name' =\u003e 'Первый товар..'],         \n                'lv' =\u003e ['name' =\u003e 'Pirmā prece.'],\n            ],\n        ]\n    ];\n\n    $invoice = invoice()\n        -\u003esetItems($items)\n        -\u003esetPaymentDetails('VISA ending XXXX')\n        \n        -\u003eforUser($user) // optional - set associated user (user relation should be enabled and configured)\n        -\u003esetInvoiceNr('MY123') // optional - set custom invoice nr.\n        -\u003esetVat(21) // optional - overrides vat specified in config\n        -\u003esetSender([ 'name' =\u003e 'My awesome company', ... ]) // optional - overrides sender data specified in config\n        -\u003esetReceiver([ 'first_name' =\u003e ..., 'last_name' =\u003e ... ]) // optional - overrides receiver data\n        -\u003emergeReceiver([ 'some_additional_field' =\u003e ... ]) // optional - use if you need to add some extra receiver data\n\n        -\u003emake(); // build eveything up and returns Invoice instance\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-invoice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcore%2Fmodule-invoice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-invoice/lists"}