Code Monkey home page Code Monkey logo

laravel-printing's Introduction

๐Ÿ‘‹ Hi there! I'm Randall Wilk

I'm a full-stack web developer that specializes in the Laravel framework.

rawilk's github stats Top Languages

Favorite Tech

Tools, languages, and other things that I like to work with.

Dev tools & languages

PHP MySQL Laravel NPM TailwindCSS Vite CSS3 Shell Script Nginx Git

Software & tools

Google Chrome macOS PhpStorm DigitalOcean Spotify Ubuntu Alfred GitHub Apple

laravel-printing's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar laravel-shift avatar looxisdev avatar rawilk avatar vanrijs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-printing's Issues

Feature Request: Add ability to access driver directly

From what I can tell right now, it doesn't look like you can directly access the driver and thus the client under it for something like PrintNode.

Their API contains a number of helpful routes like whoami, computers, and more that would be nice to access from the library without using PrintNode directly.

Question: [InvalidArgumentException]

HI,

I am getting the following error when I try to install this package:

[InvalidArgumentException]
Package rawilk/laravel-printing has a PHP requirement incompatible with your PHP version, PHP extensi
ons and Composer version

I am new to Laravel so I hope you dont mind if I am doing something stupid.

Here is my composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.12",
        "laravel/tinker": "^2.5"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

CUPS driver usage kind of broken on v1.3

Description

When attempting to use CUPS in v1.3, it seems that it's usage is broken in a few ways:

  1. Just installing the package results in errors (Issue #11, partially fixed by #14 )
  2. When applying the fix from #14, then there is a deprecation notice when just even attempting to list printers.
<warning>PHP Deprecated:  Passing a Psr\Http\Message\ResponseFactoryInterface and a Psr\Http\Message\StreamFactoryInterface to SocketClient is deprecated, and will be removed in 3.0, you should only pass config options. in /var/www/html/project/vendor/php-http/socket-client/src/Client.php on line 59</warning>

  1. Beyond the deprecation notice, listing printers also fails due to the following exception:
TypeError: Argument 2 passed to Rawilk\Printing\Drivers\Cups\Cups::remoteServer() must be of the type string, null given, called in /var/www/html/project/vendor/rawilk/laravel-printing/src/Factory.php on line 46

This error cryptically is trying to say that a username/password are required, but the defaults for the username and password in the published config don't have a default and become null which generates the error.

Once I set the username/password to be blank strings, I then got the following error:

Rawilk\Printing\Exceptions\InvalidDriverConfig with message 'Remote CUPS server requires a username and password.'

This seems to be due to a arbitrary requirement of needing a username and password for a remote cups server.
While not great security wise to have no username/password when I remove the conditional that validates for requiring username/password, the CUPS calls work just fine (albeit with the deprecation notices).

Steps to reproduce

Install the package, configure only a valid CUPS_SERVER_IP, run Printing::printers()
Additionally, setting a username/password results in similar errors minus the error on requiring a username/password

Context

  • Laravel Printing version: 1.3
  • Laravel version: 8.35.1

Receipt items loop not possible

Hi friends

I am developing a receipt for thermal printer, but I have the problem of not being able to iterate items, because it only allows to print strings and it is not possible to use an array.

Is it not possible to make a loop with all the items of the receipt?

Thanks

Context

  • Laravel Printing version: v1
  • Laravel version: 8

๐Ÿ–จ๏ธ Mock printer for local testing

Feature Description

Mock printer driver that will store files in the local storage it may handle multiple formats like "pdf" or raw files, printer id can be a folder.

Is this feature valuable for other users as well and why?

Useful for local testing, manual and automated through tests.

[Feature Request]: Doc Update with an example of Local IP Printer

Feature Description

I'm migrating from charlieuki/receipt-printer for Following Reasons:

  • Not able to print custom text
  • Too Tied with the non dynamic format
  • Not compliant with new php version

Now the question is what would be the configuration for rawilk/laravel-printing if I have a Local printer as follows:

connector_type: "network",
connector_discriptor: "192.168.2.248",
port: 9100

Code given above worked in charlieuki/receipt-printer
But not sure how to use this info in this package
I've tried so many snippets from the existing doc but none of them shows what config it requires.

Is this feature valuable for other users as well and why?

Yes, it's definitely valuable to others as there are very very less information & Laravel packages on the web for POS Printing, And only this package looks promising.

Can't use contentType pdf_base64 with Printnode

Description

Currently I can see no way of using the ContentType pdf_base64 for Printnode via the content() method.

public function content($content): self
    {
        $this->job->content = base64_encode($content);
        $this->job->contentType = ContentType::RAW_BASE64;

        return $this;
    }

RAW_BASE64 is hardcoded in the content() method.

For CUPS there is a additional $contentType parameter for the content() method.

public function content($content, string $contentType = ContentType::PDF): self

It would be great if this parameter can be added to the printnode drivers PrintTask class, too.

I can add a Pull Request, if mandatory.

Kind Regards
Christian

Arabic language print problem

Laravel Printing Version

v3

Laravel Version

v8

Bug description

when I connect my print node client and start to print around it's printing the Arabic language English direction from left to right and that is a problem any ideas on how to fix this

Steps to reproduce

No response

Relevant log output

No response

Scan jobs?

Is there any way that we can send scan job to the printer and retrieve the scanned file? preferably using CUPS driver.

Can't use Guzzle when install library

Description

Steps to reproduce

After installing library can't use Guzzle for making requests

Context
-Laravel 8
-PHP 7.4
-Windows 10 64bit

Error I am getting:

{ "message": "Interface 'Psr\\Http\\Client\\ClientInterface' not found", "exception": "Error", "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\guzzlehttp\\guzzle\\src\\Client.php", "line": 17, "trace": [ { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\composer\\ClassLoader.php", "line": 444, "function": "include" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\composer\\ClassLoader.php", "line": 322, "function": "Composer\\Autoload\\includeFile" }, { "function": "loadClass", "class": "Composer\\Autoload\\ClassLoader", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Client\\PendingRequest.php", "line": 639, "function": "spl_autoload_call" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Client\\PendingRequest.php", "line": 573, "function": "buildClient", "class": "Illuminate\\Http\\Client\\PendingRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\helpers.php", "line": 234, "function": "Illuminate\\Http\\Client\\{closure}", "class": "Illuminate\\Http\\Client\\PendingRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Client\\PendingRequest.php", "line": 589, "function": "retry" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Client\\PendingRequest.php", "line": 493, "function": "send", "class": "Illuminate\\Http\\Client\\PendingRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\app\\DistOne\\DistOneApiClient.php", "line": 132, "function": "post", "class": "Illuminate\\Http\\Client\\PendingRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\app\\DistOne\\DistOneApiClient.php", "line": 80, "function": "readData", "class": "App\\DistOne\\DistOneApiClient", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\app\\Http\\Controllers\\OrdersController.php", "line": 49, "function": "getOrders", "class": "App\\DistOne\\DistOneApiClient", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php", "line": 54, "function": "ajaxOrders", "class": "App\\Http\\Controllers\\OrdersController", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 254, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 197, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 692, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 128, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\app\\Http\\Middleware\\CheckRole.php", "line": 22, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "App\\Http\\Middleware\\CheckRole", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\app\\Http\\Middleware\\LogoutIfNotActive.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "App\\Http\\Middleware\\LogoutIfNotActive", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php", "line": 41, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php", "line": 78, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\AuthenticateSession.php", "line": 58, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Session\\Middleware\\AuthenticateSession", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php", "line": 44, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Auth\\Middleware\\Authenticate", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php", "line": 49, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php", "line": 121, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php", "line": 63, "function": "handleStatefulRequest", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php", "line": 67, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 103, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 694, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 669, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 635, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 624, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 166, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 128, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php", "line": 86, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\fruitcake\\laravel-cors\\src\\HandleCors.php", "line": 37, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Fruitcake\\Cors\\HandleCors", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\fideloper\\proxy\\src\\TrustProxies.php", "line": 57, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 167, "function": "handle", "class": "Fideloper\\Proxy\\TrustProxies", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 103, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 141, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 110, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\public\\index.php", "line": 52, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "E:\\projekti\\Lee Distributors\\orders-tracking\\server.php", "line": 21, "function": "require_once" } ] }

[Feature Request]:

Feature Description

Is there a way to add a QR code to the receipt printer?

Is this feature valuable for other users as well and why?

No response

Arabic not printing convert to wrong text

Laravel Printing Version

v3.0.0

Laravel Version

v8

Print Driver

PrintNode

Bug description

my arabic words are not printing i think its any encoding issue see image
convert this ุงู„ุชุฌุงุฑ ุงู„ุจุทู„ to this t2ร‡รกรŠรŒร‡ร‘ ร‡รกรˆร˜รก

image

Steps to reproduce

No response

Relevant log output

No response

content() and url() methods not working

Laravel Printing Version

v3.0.0

Laravel Version

v9.19

Bug description

file methods works fine when we try to print but

Printing::newPrintTask()
->printer($printerId)
->content('hello world')
->send();

and

Printing::newPrintTask()
->printer($printerId)
->url('https://www.google.com')
->send();

functions not working when we try to print. Inside PrintNode application, on logs section we can see PrintJob id and done message but nothing comes out from our printer. And no error shows up in our project.

Steps to reproduce

No response

Relevant log output

No response

No Printer Found

I have installed the package and Printnode. Set the api but when i do

print_r(Printing::printers());

Array is empty

Please Help ... thanks

[Feature Request]: Multiple PrintNode keys

Feature Description

Is there any way to handle multiple printnode keys in order to manage multiple printnode subscriptions ?

Is this feature valuable for other users as well and why?

No response

Incompatible HTTP factory

Laravel Printing Version

3.0.3

Laravel Version

10.17.1

Print Driver

CUPS

Bug description

I've installed the package and the CUPS driver like documented. After setting up the credentials I try to show the available printers. This then results in an error.

So first:

composer require rawilk/laravel-printing
composer require smalot/cups-ipp

Then run tinker: php artisan tinker

Psy Shell v0.11.20 (PHP 8.1.3 โ€” cli) by Justin Hileman
> dump(Printing::printers())

   LogicException  You cannot use "Http\Message\MessageFactory\GuzzleMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead.                                                                                                                     

Basically we need the deprecated php-http/message-factory package to send requests.

However, when you install the deprecated package you get conflicts in the interfaces with the already currently installed psr/http-factory package:

composer require php-http/message-factory

Then run tinker: php artisan tinker

Psy Shell v0.11.20 (PHP 8.1.3 โ€” cli) by Justin Hileman
> dump(Printing::printers())

In Stream.php line 79:
                                                                                                                             
  Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void  

I suppose that we'd need to use the newly provided interfaces by psr/http-factory to fix the issue.

I can't drop the psr/http-factory package since it's being used by phpoffice/phpspreadsheet:

$ composer why psr/http-factory
guzzlehttp/psr7          2.6.0  requires psr/http-factory (^1.0) 
nyholm/psr7              1.8.0  requires psr/http-factory (^1.0) 
php-http/client-common   2.7.0  requires psr/http-factory (^1.0) 
phpoffice/phpspreadsheet 1.29.0 requires psr/http-factory (^1.0) 

Steps to reproduce

No response

Relevant log output

No response

Unable to use the package | Non-static method printers() cannot be called statically

I have installed this package on a fresh installation, completed all the steps from the Docs. Using CUPS and getting this error
Non-static method Rawilk\Printing\Printing::printers() cannot be called statically

I have setup the cups server info in the env and the server is accessible from browser.

I tried using it like this $printer = (new Printing)->printers(); and got this error Too few arguments to function Rawilk\Printing\Printing::__construct()

Question: HTTP Error (400): 'offset' not supported

HI,
Thanks for the awesome plugin.

i am using below two lines to return all printers in my controller file.

$printers = Printing::printers();
return $printers;

It does not show anything.

Then i find rawlink/laravel-printing/src/printing.php file where i pass the $e. Then i get the error [{"statusCode":"400","message":"HTTP Error (400): 'offset' not supported"}]

public function printers(): Collection
{
    try {
        $printers = $this->driver->printers();
    } catch (\Throwable $e) {
        $printers = collect([$e]);
    }
    $this->resetDriver();
    return $printers;
}

Am i doing something wrong?

CUPS Printer driver unable to print

Description

Unable to print via CUPS driver, getting 'A non-numeric value encountered'

$printers = Printing::printers();

Printing::newPrintTask()
    ->file(public_path('sample.pdf'))
    ->printer($printers->first()->id())
    ->send();

Screenshot 2020-09-04 at 5 39 40 PM

Screenshot 2020-09-04 at 5 42 21 PM

Steps to reproduce

  1. Used CUPS driver to print

Context

  • Laravel Printing version: 1.2.0
  • Laravel version: 7.27.0

Unable to print ZPL code

Laravel Printing Version

v3.0.3

Laravel Version

v10.13.5

Print Driver

PrintNode

Bug description

When trying to print ZPL code via PrintNode with the following code:

$zplCode = <<<EOT
^XA
^CFA,30
^FO50,300^FDJohn Doe^FS
^FO50,340^FD100 Main Street^FS
^FO50,380^FDSpringfield TN 39021^FS
^FO50,420^FDUnited States (USA)^FS
^XZ
EOT;

$printJob = Printing::newPrintTask()
    ->printer($printerId)
    ->content($zplCode)
    ->send();

I always get the code printed on the label but its not converted.

When debugging the returned $printJob I do see that its contentType is raw_uri and not raw_base64.

How can I set the contentType with the above code to ensure it's correctly printed?

Steps to reproduce

No response

Relevant log output

No response

How can i get print job id after send a job?

Description

After send a job, how can i get print job id from print node?

Steps to reproduce

Printing::newPrintTask() ->printer($printerId) ->file('path_to_file.pdf') ->send();

Context

  • Laravel Printing version: 1.1.3
  • Laravel version: 7.x

Raw printing not working

Hi,

I am trying to print a label on zebra printer using zpl format. I thought using content() should work. It creates the job but nothing prints.

Dynamic printer_node_api key not Updated From V-3.0.0

Laravel Printing Version

v3.0.0

Laravel Version

v8.0

Print Driver

PrinterNode

Bug description

set the printer_node_api_key from controller dynamically
Config::set('printing.drivers.printnode.key', 'my-printer-node-key');
it showing API key is missing in response here is my code
after that i downgrad to v2.0.0 and it works fine

use \Rawilk\Printing\PrintTask;
use \Rawilk\Printing\Receipts\ReceiptPrinter;

public function xprinter(Request $request)
{
Config::set('printing.drivers.printnode.key', 'my-printer-node-key');
    try {
        $text = (string) (new ReceiptPrinter)
        ->centerAlign()
        ->text('My heading')
        ->leftAlign()
        ->line()
        ->twoColumnText('Item 1', '2.00')
        ->twoColumnText('Item 2', '4.00')
        ->feed(2)
        ->centerAlign()
        ->barcode('1234')
        ->cut();

        $printJob= new PrintTask;
        $printJob->printer("printer_id");
        $printJob->content($text);
        $printJob->send();
    } catch(Exception $e) {
        echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
    }
}

Steps to reproduce

No response

Relevant log output

API key Missing

Cannot install on PHP version 8.1 or 8.2.

Laravel Printing Version

Latest

Laravel Version

10.13.5

Print Driver

N/A

Bug description

Cannot install on on PHP 8.2.5

Steps to reproduce

No response

Relevant log output

ฮป composer require rawilk/laravel-printing
./composer.json has been updated
Running composer update rawilk/laravel-printing
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - rawilk/laravel-printing[1.0.0, ..., 1.3.0] require php ^7.4 -> your php version (8.2.5) does not satisfy that requirement.
    - rawilk/laravel-printing 2.0.0 requires illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - rawilk/laravel-printing[v3.0.0, ..., v3.0.1] require illuminate/support ^8.0|^9.0 -> found illuminate/support[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.9] but these were not loaded, likely because it conflicts with another require.
    - rawilk/laravel-printing[v3.0.2, ..., v3.0.3] require mike42/escpos-php ^4.0 -> found mike42/escpos-php[v4.0] but the package is fixed to v2.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires rawilk/laravel-printing * -> satisfiable by rawilk/laravel-printing[1.0.0, ..., 1.3.0, 2.0.0, v3.0.0, v3.0.1, v3.0.2, v3.0.3].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require rawilk/laravel-printing:*" to figure out if any version is installable, or "composer require rawilk/laravel-printing:^2.1" if you know which you need..0.0, v3.0.0, v3.0.1, v3.0.2, v3.0.3].

HttpClient not found Error

I am getting following error. any thoughts. php version is 8.1 and laravel 8.0
Error: Interface "Http\Client\HttpClient" not found in /vendor/rawilk/laravel-printing/src/Drivers/Cups/Support/Client.php:27

Cups Printing::find broken when invalid id is passed

Description

Using Cups on v1.3, when calling Printing::find on an invalid ID, results in a Rawilk\Printing\Drivers\Cups\Entity\Printer instance, but for a random printer. This means that there's really no way to confirm that the printer being looked up is the right one.

Steps to reproduce

Having a working CUPS server with printers configured. Call Printing::find('invalid'), and see that you still get a printer instance.

When dumping the Entity, you can see in the ResponseParser the following:

#responseParser: Smalot\Cups\Transport\ResponseParser^ {#5518
      #content: "\x01\x01\x04\x06\x00\x00\x00\x04\x01G\x00\x12attributes-charset\x00\x08us-asciiH\x00\eattributes-natural-language\x00\x05en-usA\x00\x0Estatus-message\x00#The printer or class was not found.\x03"

So there is already the knowlege that it wasn't found, but the package isn't validating anything in this case.

Context

  • Laravel Printing version: 1.3.0
  • Laravel version: 8.35.1

Rawilk\Printing\Receipts\ReceiptPrinter Not Working

Laravel Printing Version

v3.0.0

Laravel Version

v9

Print Driver

PrintNode

Bug description

$receipt = (string) (new ReceiptPrinter)
->centerAlign()
->text('My heading')
->leftAlign()
->line()
->twoColumnText('Item 1', '2.00')
->twoColumnText('Item 2', '4.00')
->feed(2)
->centerAlign()
->barcode('1234')
->cut();

// Now send the string to your receipt printer
Printing::newPrintTask()
->printer($receiptPrinterId)
->content($receipt)
->send();

Steps to reproduce

just copy code

Relevant log output

job ID :2989074766

cURL error 60: SSL certificate problem: self signed certificate in certificate chain

i need help

i use Rawilk\Printing\Facades\Printing as namespace;

$printerId = 72467752;
Printing::newPrintTask()
->printer($printerId)
->file(public_path($filename))
->send();

and i run this code, it returns cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.printnode.com/printjobs.

also when i run

$printers = Printing::printers();

    dd($printers);

it also return a blank array. thanks

Error with guzzle after installing the laravel-printing

Description

I've installed laravel-printing using composer. In my application i use GuzzleHttp\Client, but after the installation i get back this error when i'm using it.

Error
Interface 'Psr\Http\Client\ClientInterface' not found

If i remove laravel-printing, it works fine.

Context

  • Laravel Printing version: [1.3]
  • Laravel version: [7.29.2]

Send name of job to CUPS - Resolved

Laravel Printing Version

v3.0.0

Laravel Version

v9.01

Bug description

Hello! This package is wonderful :-) Thank you.

I want to ask one question. I'm using it with cups (installed on wsl2 on windows server of my customer).

I want to send name of the file with ->jobTitle() to the cups.

The cups is not showing the name of the job.

How I could resolve?

Thank you

Steps to reproduce

No response

Relevant log output

No response

Fatal error: Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close():

Laravel Printing Version

v3.0.3

Laravel Version

v10.15

Print Driver

Cups

Bug description

I have used this package with printnode and it worked great. Now that i switched to Cups it results in an error.
I am using this code:

Rawilk\Printing\Facades\Printing
$printers = Printing::printers();


foreach ($printers as $printer) {
    dump($printer->name()) ;
}

It results in the following error:
Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void

I have followed the docs witch instructed to install smalot/cups-ipp.
But it seems not to help at all.

If i fix the issue manually adding : void after the close method a new error comes up staing that there is another compatibility issue.

Steps to reproduce

  1. Install laravel
  2. run: composer require rawilk/laravel-printing
  3. run: composer require smalot/cups-ipp
  4. Run the code as described in the bug.

Relevant log output

PHP Fatal error:  Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void in \vendor\php-http\socket-client\src\Stream.php on line 79

   Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void

  at vendor\php-http\socket-client\src\Stream.php:79
     75โ–•
     76โ–•     /**
     77โ–•      * {@inheritdoc}
     78โ–•      */
  โžœ  79โ–•     public function close()
     80โ–•     {
     81โ–•         if ($this->isDetached || null === $this->socket) {
     82โ–•             throw new StreamException('Stream is detached');
     83โ–•         }


   Whoops\Exception\ErrorException 

  Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void

  at vendor\php-http\socket-client\src\Stream.php:79
     75โ–•
     76โ–•     /**
     77โ–•      * {@inheritdoc}
     78โ–•      */
  โžœ  79โ–•     public function close()
     80โ–•     {
     81โ–•         if ($this->isDetached || null === $this->socket) {
     82โ–•             throw new StreamException('Stream is detached');
     83โ–•         }

  1   vendor\filp\whoops\src\Whoops\Run.php:510
      Whoops\Run::handleError("Declaration of Http\Client\Socket\Stream::close() must be compatible with Psr\Http\Message\StreamInterface::close(): void", "\vendor\php-http\socket-client\src\Stream.php")

  2   [internal]:0
      Whoops\Run::handleShutdown()

file method not working

Laravel Printing Version

v3

Laravel Version

9.46

Print Driver

CUPS

Bug description

I want to print a pdf file on a thermal printer which is installed on a raspberry pi using CUPS. I'm unable to do it so far . If i send it from iPhone or mac ,is printed successfully so i think the problem is elsewhere.

for example this :

Printing::newPrintTask()->printer(Printing::defaultPrinterId())->file('files/test.pdf')->send();

doesn't work. Every other method works (content,URL) as it should.

Edit: File method works with other files for example .jpg but not with .pdf file

installation issue

I am not able to install this package.

Problem 1
- Root composer.json requires rawilk/laravel-printing ^2.0 -> satisfiable by rawilk/laravel-printing[2.0.0].
- rawilk/laravel-printing 2.0.0 requires mike42/escpos-php ^3.0 -> found mike42/escpos-php[v3.0] but the package is fixed to v2.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

installation problem

i follow all steps

how to use this

$printJob = Printing::newPrintTask()
->printer($printerId)
->file('path_to_file.pdf')
->send();

$printJob->id();
in class how to access printing class

Content() dont work

Laravel Printing Version

v3

Laravel Version

v8

Bug description

I can print pdf file but i want print text content() dont work .
$printerId = '71387975';

$text = (string) (new ReceiptPrinter)
->centerAlign()
->text('My heading')
->leftAlign()
->line()
->twoColumnText('Item 1', '2.00')
->twoColumnText('Item 2', '4.00')
->feed(2)
->centerAlign()
->barcode('1234')
->cut();

    Printing::newPrintTask()
        ->printer($printerId)
        ->content($text) 
        ->send();

Steps to reproduce

.

Relevant log output

.

SERVER ERROR

Laravel Printing Version

LATEST

Laravel Version

9.20.0

Print Driver

PrintNode

Bug description

Everytime I try to print I get a server error. It worked a few weeks ago, but for some reason it doesn't work now.

Steps to reproduce

No response

Relevant log output

500 | SERVER ERROR

I can not access to my php admin

Laravel Printing Version

v4.9.8.0

Laravel Version

v8

Print Driver

N/A

Bug description

I can not access to my php admin I've tried every way

Steps to reproduce

No response

Relevant log output

No response

Laravel 10 not support

Laravel Printing Version

v3.0.3

Laravel Version

v10.13.5

Print Driver

N/A

Bug description

It can't install on this version of laravel

Steps to reproduce

No response

Relevant log output

Problem 1
    - rawilk/laravel-printing[v3.0.2, ..., v3.0.3] require mike42/escpos-php ^4.0 -> satisfiable by mike42/escpos-php[v4.0].    
    - rawilk/laravel-printing[1.0.0, ..., 1.3.0] require php ^7.4 -> your php version (8.2.4) does not satisfy that requirement.    - rawilk/laravel-printing 2.0.0 requires illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - rawilk/laravel-printing[v3.0.0, ..., v3.0.1] require illuminate/support ^8.0|^9.0 -> found illuminate/support[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.10] but these were not loaded, likely because it conflicts with another require.
    - mike42/escpos-php v4.0 requires ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.     
    - Root composer.json requires rawilk/laravel-printing * -> satisfiable by rawilk/laravel-printing[1.0.0, ..., 1.3.0, 2.0.0, 
v3.0.0, v3.0.1, v3.0.2, v3.0.3].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-intl` to temporarily ignore these required extensions.      
You can also try re-running composer require with an explicit version constraint, e.g. "composer require rawilk/laravel-printing:*" to figure out if any version is installable, or "composer require rawilk/laravel-printing:^2.1" if you know which you need.

Wiki Not Accessible

Description

Wiki URL returning HTTP 500 Server Error

Steps to reproduce

Multiple cross platform browser check & httpstatus.io

Context

  • Laravel Printing version: 1.2.2
  • Laravel version: N/A

No printer on localhost

I have installed the package and Printnode. Set the api but when i do

print_r(Printing::printers());

Array is empty

Any hint please? Thanks

Printing logo in receipt

Hi,

I'm testing your lib and it is working as expected. I have a question, how can I print a logo in receipt? Is there a command to it?

If there's none... where to start to lookup and maybe help you.

Thanks in advance

No Printer Found

I have installed this package and set api key in config. Printnode client software also installed and logged in with api key.

Printer is connected and showing active with online status on Printnode Client software.

But from code there is no printer id or name listing, it's all null.

$printers = Printing::printers(); foreach ($printers as $printer) { echo $printer->name(); }

Any help?

Printers not listed

Laravel Printing Version

v3

Laravel Version

v9

Print Driver

PrintNode

Bug description

When i list the printers it displays empty array, although i have printers.

$printers = \Printing::printers();
dd($printers);

Steps to reproduce

No response

Relevant log output

No response

Interface 'Psr\Http\Client\ClientInterface' not found

Description

PSR Client interface not found (vendor/php-http/httplug/src/HttpClient.php:13)

Steps to reproduce

  • Fresh install laravel 8
  • Install laravel-printing
  • Add sample route:
Route::get('/printers', function() {
    $printers = \Rawilk\Printing\Facades\Printing::printers();
    ddd($printers);
});

multi-language support

Is it possible to use multilanguage?
I am interested in Greek language ,to be more specific.
Every time i use Greek,the outcome is formatted to hexadecimal i believe.

printer id must be an integer specified as (request body).printer.id or (request body).printer or (request body).printerId

Laravel Printing Version

v3

Laravel Version

v9

Bug description

Hi im having this issue when using laravel-printing
my code is here :

public function print(){
$print = Printing::newPrintTask()
->printer(765766676)
->file('file.pdf')
->send();

    return $print;
}

the response of this request is : printer id must be an integer specified as (request body).printer.id or (request body).printer or (request body).printerId

Thank you

Steps to reproduce

No response

Relevant log output

No response

Unable to list printers on PrintNode due to offset not supported

Description

List printers with PrintNode.

$printers = Printing::printers()

Nothing is returned. After further investigation, PrintNode 2.0@RC1 is very old 2015 and does not match their API anymore.

dev-master is up to date as they have not tagged a new release as far as I can tell.

This occurs in all versions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.