public function getImagesByTag($tag = null)
    {
        $images = $this->model->orderBy('created_at', 'desc')->where('is_published', 1);

        if (!is_null($tag)) {
            $images->where('tags', 'LIKE', '%'.$tag.'%');
        }

        return $images;
    }
public function getImagesByTag($tag = null)
    {
        $images = $this->model->orderBy('created_at', 'desc')->where('is_published', 1);

        if (!is_null($tag)) {
            $images->where('tags', 'LIKE', '%'.$tag.'%');
        }

        return $images;
    }
public function getImagesByTag ( $ tag = null ) { $ images = $ this -> model -> orderBy ( 'created_at' , 'desc' ) -> where ( 'is_published' , 1 ) ; if ( ! is_null ( $ tag ) ) { $ images -> where ( 'tags' , 'LIKE' , '%' . $ tag . '%' ) ; } return $ images ; }
Returns all Images for the API.

@return \Illuminate\Database\Eloquent\Collection|static[]
Returns all Images for the API .