Page rendering issue
I'm trying to build a page that displays a CUPS printer queue but my page is presending a bit weird. The button that I would expect per queue is just one big button with multiple names all on one button, and then the items in a queue are just showing. The line breaks never appear. Thoughts?
<x-filament-panels::page>
@foreach($this->printer_list() as $which)
<x-filament::button> {{ $which }}</x-filament::button>
@endforeach
@foreach($this->job_queue('sths-main-office-brad-desk') as $which)
{{ $which }}<BR><BR>
@endforeach
</x-filament-panels::page>
Solution:Jump to solution
Aha - found it . . . using PHP_EOL to split lines now. That solved it.
` public static function printer_list()
{
$result = Process::run('lpstat -e');...
4 Replies
Could you share a screenshot?
does it work?
Solution
Aha - found it . . . using PHP_EOL to split lines now. That solved it.
public static function printer_list()
{
$result = Process::run('lpstat -e');
$printer_queues = $result->output();
return explode(PHP_EOL,$printer_queues);
}
public static function job_queue($printer_queue)
{
$result = Process::run('lpstat '.$printer_queue . ' -W not-completed');
$printer_queues = $result->output();
return explode(PHP_EOL,$printer_queues);
}