Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Pad array to the specified length with a value
<?php array_pad(array $array, int $length, mixed $value): array
<?php     public function pad($size, $value)

    {

        return new static(array_pad($this->items, $size, $value));

    }
<?php     protected function parseSchemaAndTable($reference)

    {

        $parts = array_pad(explode('.', $reference, 2), -2, null);



        if (str_contains($parts[1], '.')) {

            $database = $parts[0];
<?php     protected function parseMiddleware($middleware)

    {

        [$name, $parameters] = array_pad(explode(':', $middleware, 2), 2, []);



        if (is_string($parameters)) {

            $parameters = explode(',', $parameters);
<?php     protected function parsePipeString($pipe)

    {

        [$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);



        if (is_string($parameters)) {

            $parameters = explode(',', $parameters);
<?php     protected function parseQueues($queues)

    {

        return collect(explode(',', $queues))->map(function ($queue) {

            [$connection, $queue] = array_pad(explode(':', $queue, 2), 2, null);



            if (! isset($queue)) {

                $queue = $connection;
<?php         [$name, $parameters] = array_pad(explode(':', $name, 2), 2, null);



        return ($map[$name] ?? $name).(! is_null($parameters) ? ':'.$parameters : '');

    }
<?php                 continue;

            }



            [$middleware, $parameters] = array_pad(

                explode(':', $middleware, 2), 2, null

            );
<?php     public function parseNamedParameters($parameters)

    {

        return array_reduce($parameters, function ($result, $item) {

            [$key, $value] = array_pad(explode('=', $item, 2), 2, null);



            $result[$key] = $value;