public function image()
    {
        if ($this->relationLoaded('mediables')) {
            return $this->mediables->where('type', 'image')->first();
        }

        return $this->mediables()
            ->where('media.type', 'image')
            ->whereNull('mediables.type')
            ->first();
    }
public function image()
    {
        if ($this->relationLoaded('mediables')) {
            return $this->mediables->where('type', 'image')->first();
        }

        return $this->mediables()
            ->where('media.type', 'image')
            ->whereNull('mediables.type')
            ->first();
    }
public function image ( ) { if ( $ this -> relationLoaded ( 'mediables' ) ) { return $ this -> mediables -> where ( 'type' , 'image' ) -> first ( ) ; } return $ this -> mediables ( ) -> where ( 'media.type' , 'image' ) -> whereNull ( 'mediables.type' ) -> first ( ) ; }
Image object.

@return \Routegroup\Media\File
Image object .