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:
Aha - found it . . . using PHP_EOL to split lines now. That solved it. ` public static function printer_list() { $result = Process::run('lpstat -e');...
Jump to solution
4 Replies
LeandroFerreira
Could you share a screenshot?
HeartlandTechie
HeartlandTechieOP2d ago
No description
LeandroFerreira
does it work?
@foreach($this->printer_list() as $which)
<x-filament::button> {{ fake()->name }}</x-filament::button>
@endforeach
@foreach($this->printer_list() as $which)
<x-filament::button> {{ fake()->name }}</x-filament::button>
@endforeach
Solution
HeartlandTechie
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); }
Want results from more Discord servers?
Add your server