public function country($country_id, Request $request = null)
    {
        $country = Country::with('zone')->find($country_id);

        if ($request) {
            $included = [];
            $query = $country->getInlcudeResources($request->include);
            if ($query) {
                $collection = new Collection(
                    $query,
                    str_singular($request->include)
                );
                $included = $collection->toArray();
            }
            $links = $request ? ['self' => $request->url()] : [];
            return $this->respondWithItem(
                $country,
                'country',
                $links,
                $included
            );
        }
        return $country;
    }
public function country($country_id, Request $request = null)
    {
        $country = Country::with('zone')->find($country_id);

        if ($request) {
            $included = [];
            $query = $country->getInlcudeResources($request->include);
            if ($query) {
                $collection = new Collection(
                    $query,
                    str_singular($request->include)
                );
                $included = $collection->toArray();
            }
            $links = $request ? ['self' => $request->url()] : [];
            return $this->respondWithItem(
                $country,
                'country',
                $links,
                $included
            );
        }
        return $country;
    }
public function country ( $ country_id , Request $ request = null ) { $ country = Country :: with ( 'zone' ) -> find ( $ country_id ) ; if ( $ request ) { $ included = [ ] ; $ query = $ country -> getInlcudeResources ( $ request -> include ) ; if ( $ query ) { $ collection = new Collection ( $ query , str_singular ( $ request -> include ) ) ; $ included = $ collection -> toArray ( ) ; } $ links = $ request ? [ 'self' => $ request -> url ( ) ] : [ ] ; return $ this -> respondWithItem ( $ country , 'country' , $ links , $ included ) ; } return $ country ; }
Get Country item. Optional include administrative areas

@param int $country_id
@param Illuminate\Http\Request $request
@return mixed Jnaxo\CountryCodes\Country item
Get Country item . Optional include administrative areas