src/Http/Responds.php
public function respond(array $data = [], array $headers = []): JsonResponse
    {
        $meta = [
            'meta' => [
                'server_time' => time(),
                'server_timezone' => date_default_timezone_get(),
                'api_version' => 'v1',
            ],
        ];

        return response()->json(array_merge($data, $meta), $this->getStatusCode(), $headers);
    }
public function respond(array $data = [], array $headers = []): JsonResponse
    {
        $meta = [
            'meta' => [
                'server_time' => time(),
                'server_timezone' => date_default_timezone_get(),
                'api_version' => 'v1',
            ],
        ];

        return response()->json(array_merge($data, $meta), $this->getStatusCode(), $headers);
    }
public function respond ( array $ data = [ ] , array $ headers = [ ] ) : JsonResponse { $ meta = [ 'meta' => [ 'server_time' => time ( ) , 'server_timezone' => date_default_timezone_get ( ) , 'api_version' => 'v1' , ] , ] ; return response ( ) -> json ( array_merge ( $ data , $ meta ) , $ this -> getStatusCode ( ) , $ headers ) ; }
Return JSON encoded response.

@param array $data
@param array $headers

@return \Illuminate\Http\JsonResponse
Return JSON encoded response .