Author Profiles
FrankenCMS adds author profile fields to your users, making it easy to display author bios, photos, and social links alongside their published content.
Profile Fields
Each user has the following author profile fields available:
| Field | Description |
|---|---|
| Bio | A short author biography displayed on posts and author pages |
| Profile Photo | Author avatar image, managed through the media library |
| Website | Personal or professional website URL |
| Twitter / X | Twitter/X profile handle |
| LinkedIn profile URL |
Displaying Author Info
Every post has an author relationship. Use it in your Blade templates to display author
information:
<div class="author-bio">
@if($post->author->profile_photo_url)
<img src="{{ $post->author->profile_photo_url }}" alt="{{ $post->author->name }}">
@endif
<h3>{{ $post->author->name }}</h3>
@if($post->author->bio)
<p>{{ $post->author->bio }}</p>
@endif
<div class="author-links">
@if($post->author->website)
<a href="{{ $post->author->website }}">Website</a>
@endif
@if($post->author->twitter)
<a href="https://x.com/{{ $post->author->twitter }}">Twitter</a>
@endif
@if($post->author->linkedin)
<a href="{{ $post->author->linkedin }}">LinkedIn</a>
@endif
</div>
</div>
Querying Posts by Author
Retrieve all published posts by a specific author:
use FrankenCms\Models\Post;
// Get all published posts by a specific user
$posts = Post::query()
->where('author_id', $user->id)
->where('status', 'published')
->latest()
->get();
// Or use the relationship from the User model
$posts = $user->posts()->where('status', 'published')->latest()->get();