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')
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?
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.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community