Example of Collection Methods: Push in orchidsoftware/platform

File src/Screen/Actions/Menu.php (link to Github)
class Menu extends Link
{
    //
    public function __construct()
    {
        $this
            ->addBeforeRender(function () {
                $href = $this->get('href');

                if ($href !== null) {
                    return;
                }

                $slug = $this->getSlug();

                $this
                    ->set('data-bs-toggle', 'collapse')
                    ->set('href', '#menu-' . $slug);
            })
            ->addBeforeRender(function () {
                if ($this->get('active') !== null) {
                    return;
                }

                $active = collect([])
                    ->merge($this->get('list'))
                    ->map(function (Menu $menu) {
                        return $menu->get('href');
                    })
                    ->push($this->get('href'))
                    ->filter()
                    ->map(function ($href) {
                        return [
                            $href,
                            $href . '?*',
                            $href . '/*',
                        ];
                    })
                    ->flatten();

                $this->set('active', $active->toArray());
            });
    }
    //
}