Supported Versions: PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8
Checks if the given key or index exists in the array
Alias key_exists
<?php array_key_exists(string|int|float|bool|resource|null $key, array $array): bool
<?php         $relationships = $model->relationships();



        if (array_key_exists('morphTo', $relationships)) {

            foreach ($relationships['morphTo'] as $morphTo) {

                $definition .= self::INDENT . sprintf('$table->unsignedBigInteger(\'%s\');', Str::lower($morphTo . '_id')) . PHP_EOL;

                $definition .= self::INDENT . sprintf('$table->string(\'%s\');', Str::lower($morphTo . '_type')) . PHP_EOL;