🔧 Development
G Gareth Sep 12, 2024

How to retrieve posts and show them elsewhere in an app

Hi there,

I want to display posts from specific channels elsewhere in my app and outside of the Waterhole application itself. Is there a way to do this?

Thanks!

⁨1⁩ ⁨Comment⁩

Toby Toby Waterhole Founder Sep 16, 2024

Hi @Gareth. If you've integrated Waterhole as a package into your Laravel app, then you can access the Waterhole models directly:

$posts = Waterhole\Models\Post::latest()->take(10)->get();

If your Waterhole installation is separate from your app, then an upcoming Waterhole release will contain a JSON API which will allow you to retrieve data from your Waterhole installation remotely.