public function getPublicAttributes()
    {
        $data = [];

        foreach ($this->fillable as $key) {
            if (in_array($key, $this->hidden)) {
                continue;
            }

            $value = $this->getAttribute($key);

            if ($value instanceof Carbon) {
                $value = $value->format('Y-m-d\TH:i:s\Z');
            }

            $data[$key] = $value;
        }

        return $data;
    }
public function getPublicAttributes()
    {
        $data = [];

        foreach ($this->fillable as $key) {
            if (in_array($key, $this->hidden)) {
                continue;
            }

            $value = $this->getAttribute($key);

            if ($value instanceof Carbon) {
                $value = $value->format('Y-m-d\TH:i:s\Z');
            }

            $data[$key] = $value;
        }

        return $data;
    }
public function getPublicAttributes ( ) { $ data = [ ] ; foreach ( $ this -> fillable as $ key ) { if ( in_array ( $ key , $ this -> hidden ) ) { continue ; } $ value = $ this -> getAttribute ( $ key ) ; if ( $ value instanceof Carbon ) { $ value = $ value -> format ( 'Y-m-d\TH:i:s\Z' ) ; } $ data [ $ key ] = $ value ; } return $ data ; }
Returns an array of public attributes.

@return array An array of public attributes.
Returns an array of public attributes .