Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years ago.
0

Haven't tried this, but maybe you could create a layout for each post type?

<div class="youtube-post-type">
    @yield('post-content')
</div>

Then use it if the post is a certain type

@if($post['type'] == 'youtube')
    @extends('layouts.youtube-post-type')
Last updated 2 years ago.
0

No, that part is easy. I'm asking where in database should I store format metadata like youtube links and images ID. What would be the best approach of storing them?

Last updated 2 years ago.
0

Maybe create a separate metadata table with row post_id, meta_data and type. Then look for rows matching the post_id. This could allow multiple items per post as well.

Last updated 2 years ago.
0

Yep, that would work and that's exactly how WordPress does it. While it would work fine, I was looking for an alternative approach since I've tried to avoid using a metadata table.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

banago banago Joined 21 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.