-
Notifications
You must be signed in to change notification settings - Fork 35
Docs ‐ Menu
Isaac Sai edited this page Dec 28, 2023
·
2 revisions
USSD menus although simple, can spiral out of handle quickly. Laravel USSD provides a class to help you create an easy-to-maintain menu.
<?php
use Sparors\Ussd\Menu;
Menu::build()
->text('Choose One')
->lineBreak(2)
->listing(['Mango', 'Pear'])
->when(false, fn (Menu) => $menu->line('Next'))
->prepend(fn (Menu) => $menu->line('Generated with Laravel USSD'))
->append(fn (Menu) => $menu->lineBreak()->format('Powered by %s', 'Sparors'));
// Generated with Laravel USSD
// Choose One
//
// 1.Mango
// 2.Pear
//
// Powered by Sparors