You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup Printnode and run test and i have added api correctly on driver it still shows a error
Steps to reproduce
i have added
use Rawilk\Printing\Facades\Printing;
public function printReceipt(Request $request)
{
// Validate the incoming request
$request->validate([
'printer_id' => 'required|string',
'receipt_content' => 'required|string',
]);
// Get the printer ID and receipt content from the request
$printerId = $request->input('printer_id');
$receiptContent = $request->input('receipt_content');
// Log the API key and driver configuration for debugging
\Log::info('Using PrintNode API Key:', [config('printing.drivers.printnode.api_key')]);
\Log::info('Current Driver:', [config('printing.drivers')]);
// Send the print job to the specified printer
try {
$response = Printing::print($receiptContent, [
'printer' => $printerId,
]);
// Check the response
if ($response) {
return response()->json(['message' => 'Print job created successfully!']);
} else {
return response()->json(['error' => 'Failed to create print job.'], 500);
}
} catch (\Exception $e) {
return response()->json(['error' => 'Print job failed: ' . $e->getMessage()], 500);
}
}
env('PRINTING_DRIVER', 'printnode'),
/*
|--------------------------------------------------------------------------
| Drivers
|--------------------------------------------------------------------------
|
| Configuration for each driver.
|
*/
'drivers' => [
'printnode' => [
'api_key' => env('PRINTNODE_API_KEY'), // Use environment variable
]
],
/*
|--------------------------------------------------------------------------
| Default Printer Id
|--------------------------------------------------------------------------
|
| If you know the id of a default printer you want to use, enter it here.
|
*/
'default_printer_id' => null,
/*
|--------------------------------------------------------------------------
| Receipt Printer Options
|--------------------------------------------------------------------------
|
*/
'receipts' => [
/*
* How many characters fit across a single line on the receipt paper.
* Adjust according to your needs.
*/
'line_character_length' => 45,
/*
* The width of the print area in dots.
* Adjust according to your needs.
*/
'print_width' => 550,
/*
* The height (in dots) barcodes should be printed normally.
*/
'barcode_height' => 64,
/*
* The width (magnification) each barcode should be printed in normally.
*/
'barcode_width' => 2,
],
];
on env file
PRINTNODE_API_KEY=correctly added
but it still shows
Print job failed: You must provide an api key for the PrintNode driver.
i haved done everything
please check on this why it happening
### Relevant log output
```shell
Print job failed: You must provide an api key for the PrintNode driver.
```
The text was updated successfully, but these errors were encountered:
Laravel Printing Version
^3.0
Laravel Version
11.31
Print Driver
Printnode
Bug description
I have setup Printnode and run test and i have added api correctly on driver it still shows a error
Steps to reproduce
i have added
use Rawilk\Printing\Facades\Printing;
public function printReceipt(Request $request)
{
// Validate the incoming request
$request->validate([
'printer_id' => 'required|string',
'receipt_content' => 'required|string',
]);
}
env('PRINTING_DRIVER', 'printnode'), /* |-------------------------------------------------------------------------- | Drivers |-------------------------------------------------------------------------- | | Configuration for each driver. | */ 'drivers' => [ 'printnode' => [ 'api_key' => env('PRINTNODE_API_KEY'), // Use environment variable ] ], /* |-------------------------------------------------------------------------- | Default Printer Id |-------------------------------------------------------------------------- | | If you know the id of a default printer you want to use, enter it here. | */ 'default_printer_id' => null, /* |-------------------------------------------------------------------------- | Receipt Printer Options |-------------------------------------------------------------------------- | */ 'receipts' => [ /* * How many characters fit across a single line on the receipt paper. * Adjust according to your needs. */ 'line_character_length' => 45, /* * The width of the print area in dots. * Adjust according to your needs. */ 'print_width' => 550, /* * The height (in dots) barcodes should be printed normally. */ 'barcode_height' => 64, /* * The width (magnification) each barcode should be printed in normally. */ 'barcode_width' => 2, ], ]; on env file PRINTNODE_API_KEY=correctly added but it still shows Print job failed: You must provide an api key for the PrintNode driver. i haved done everything please check on this why it happening ### Relevant log output ```shell Print job failed: You must provide an api key for the PrintNode driver. ```The text was updated successfully, but these errors were encountered: