PHP code example of misaf / vendra-blog

1. Go to this page and download the library: Download misaf/vendra-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/ */

    

misaf / vendra-blog example snippets


use Misaf\VendraBlog\Models\BlogPostCategory;

$category = BlogPostCategory::query()->create([
    'name' => ['en' => 'Announcements'],
    'status' => true,
]);

use Misaf\VendraBlog\Models\BlogPost;

BlogPost::query()->create([
    'blog_post_category_id' => $category->id,
    'name' => ['en' => 'Welcome'],
    'status' => true,
]);

use Misaf\VendraTagger\Models\Tagger;

Tagger::findOrCreate('Announcement', type: 'blog', locale: 'en');
bash
composer vendor:publish --tag=vendra-blog-migrations
php artisan migrate
bash
php artisan vendor:publish --tag=vendra-blog-translations