contributte / invoice

:memo: PDF invoice generator
https://contributte.org/packages/contributte/invoice.html
MIT License
96 stars 25 forks source link

Uncaught Error: Class 'Contributte\Invoice\Data\Company' not found #19

Closed igianni84 closed 4 years ago

igianni84 commented 4 years ago

Hi, as you can see, I receive the error

Fatal error: Uncaught Error: Class 'Contributte\Invoice\Data\Company' not found in /Applications/MAMP/htdocs/Varie/ddt.php:3 Stack trace: #0 {main} thrown in /Applications/MAMP/htdocs/Varie/ddt.php on line 3

My file php is:

<?php

$company = new Contributte\Invoice\Data\Company('John Doe', 'Los Angeles', 'Cavetown', '720 55', 'USA', '0123456789', 'CZ0123456789');
Schermata 2020-06-15 alle 16 37 35
MartkCz commented 4 years ago

You must include composer's autoloader

require __DIR__ . '/vendor/autoload.php';

$company = new Contributte\Invoice\Data\Company('John Doe', 'Los Angeles', 'Cavetown', '720 55', 'USA', '0123456789', 'CZ0123456789');
igianni84 commented 4 years ago

Yes, I have do that, but the problem is the same

Schermata 2020-06-15 alle 16 44 35
MartkCz commented 4 years ago

Please use dev-master version, v3 does not contain Contributte namespace

igianni84 commented 4 years ago

Sorry... I have do that... but I have the same problem :(

MartkCz commented 4 years ago

It's weird, did you try to update autoloader? (composer dumpautoload)

igianni84 commented 4 years ago

Yes, but nada...

MartkCz commented 4 years ago

What is the output of composer info contributte/invoice, please?

igianni84 commented 4 years ago
Schermata 2020-06-15 alle 18 44 18

Please see the screenshot

MartkCz commented 4 years ago

You haven't dev-master, 2 solutions:

First: install dev-master composer require contributte/invoice:dev-master

Second: use WebChemistry instead of Contributte e.g. Contributte\Invoice\Data\Company -> WebChemistry\Invoice\Data\Company

igianni84 commented 4 years ago

Thanks, I receive this error

Schermata 2020-06-15 alle 19 28 09
MartkCz commented 4 years ago

composer require nette/utils:^3.0 contributte/invoice:dev-master

igianni84 commented 4 years ago

Perfect! Very thanks :)