Skip to content

Exception when try to print with cups #114

@gdorner-ct

Description

@gdorner-ct

Laravel Printing Version

v4.1.0

Laravel Version

v11.45.1

Print Driver

Cups

Bug description

Hello

When I run

Printing::newPrintTask()->printer("ipp://127.0.0.1:631/printers/PDF")->file("test.pdf")->send();

I got following exception

Rawilk\Printing\Api\Cups\CupsRequestor::{closure:Rawilk\Printing\Api\Cups\CupsRequestor::request():46}(): Argument #1 ($request) must be of type Rawilk\Printing\Api\Cups\PendingRequest, Illuminate\Http\Client\PendingRequest given, called in vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php on line 34.

In the method "request" in The CupsRequestor there is the line

->when( filled($username) || filled($password), fn (PendingRequest $request) => $request->withBasicAuth($username ?? '', $password ?? ''), );

When I change this to
->when( filled($username) || filled($password), fn ($request) => $request->withBasicAuth($username ?? '', $password ?? ''), );

it works correctly.

Is the Rawilk\Printing\Api\Cups\PendingRequest on this position incorrect?

Steps to reproduce

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions