1. Go to this page and download the library: Download ojessecruz/simple-blog library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ojessecruz / simple-blog example snippets
// Via a specific Gate
'admin_middleware' => ['web', 'auth', 'can:manage-blog'],
// Via a separate guard
'admin_middleware' => ['web', 'auth:admin'],
// Combo of your app's own middleware
'admin_middleware' => ['web', 'auth', 'verified', 'super.admin'],
use Jessecruz\SimpleBlog\Contracts\Author;
class User extends Authenticatable implements Author
{
public function getBlogAuthorName(): string
{
return $this->name;
}
public function getBlogAuthorInitials(): string
{
$words = preg_split('/\s+/', trim($this->name)) ?: [];
$initials = array_map(
fn (string $w) => mb_strtoupper(mb_substr($w, 0, 1)),
array_slice($words, 0, 2),
);
return implode('', $initials);
}
public function getBlogAuthorAvatarUrl(): ?string
{
return $this->avatar_url; // or null if you don't have avatars
}
}
'admin' => 'layouts.app', // your <x-app-layout> view, no wrapper needed
'seo' => [
'site_name' => 'Hoot', // brand; null → config('app.name')
'blog_name' => "Hoot's Blog", // index title + suffix of the other pages
'index_title' => "Hoot's Blog | Product feedback and roadmaps", // optional tagline for the index only
'description' => 'Guides on collecting feedback and shipping it.', // index + categories without one
'image' => 'https://usehoot.app/img/og-card.png', // default og:image
'publisher_logo' => 'https://usehoot.app/img/logo.png', // Article publisher logo
],
'cta_view' => 'components.blog-cta',
use Jessecruz\SimpleBlog\Models\Post;
$posts = Post::published()->with('category')->latest('published_at')->get();