laravel-console-menu
laravel-console-menu copied to clipboard
Set width to 100%
Hi!
Currently I'm experimenting with this package in combination with Laravel-Zero (awesome work on both them btw :+1: !) but I had a small question, I'm trying to build a menu which has a full height and full width. However I already saw that cli-menu doesn't support setting the height of a menu, so that's out of the question. But I am currently doing the following to achieve a full width menu;
Code example:
$option = $this->menu('Pizza menu', [
'Freshly baked muffins',
'Freshly baked croissants',
'Turnovers, crumb cake, cinnamon buns, scones',
])
->setWidth($this->menu()->getTerminal()->getWidth())
->open();
Is there a more readable way of achieving the same result ? If not, would you accept a PR which the same result with the following syntax?
Proposed syntax:
$option = $this->menu('Pizza menu', [
'Freshly baked muffins',
'Freshly baked croissants',
'Turnovers, crumb cake, cinnamon buns, scones',
])
->setFullWidth()
->open();