public static function first($value, $key = 'model-name')
    {
        $file = self::getMapper();

        if (File::Exists($file)) {

            $maps = self::getMaps($file);

            return Collect($maps)->first(function ($map) use ($key, $value) {
                return isset($map[$key]) && $map[$key] == $value;
            });
        }

        return null;
    }
public static function first($value, $key = 'model-name')
    {
        $file = self::getMapper();

        if (File::Exists($file)) {

            $maps = self::getMaps($file);

            return Collect($maps)->first(function ($map) use ($key, $value) {
                return isset($map[$key]) && $map[$key] == $value;
            });
        }

        return null;
    }
public static function first ( $ value , $ key = 'model-name' ) { $ file = self :: getMapper ( ) ; if ( File :: Exists ( $ file ) ) { $ maps = self :: getMaps ( $ file ) ; return Collect ( $ maps ) -> first ( function ( $ map ) use ( $ key , $ value ) { return isset ( $ map [ $ key ] ) && $ map [ $ key ] == $ value ; } ) ; } return null ; }
Gets the first map with the given model name

@param string $value
@param string $key

@return mix (null | array)
Gets the first map with the given model name