PHP code example of webx-ui / module-blog

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

    

webx-ui / module-blog example snippets


$article->publish(at: now()->addWeek());   // on the site next Tuesday

$article->isPublished();   // false
$article->isScheduled();   // true
$article->status();        // 'scheduled'

Article::query()->published()->get();   // what a reader can see, right now

app(TagMerge::class)->merge([$belt, $driveBelts], $belts, redirect: true);

app(TagIndexing::class)->state($tag);   // 'open' · 'rule' · 'noindex'

'views' => [
    'article' => 'blog.article',
    'feed'    => 'blog.feed',
    'rubric'  => 'blog.rubric',
    'tag'     => 'blog.tag',
    'rss'     => 'blog.rss',
],
bash
php artisan webx:routes:rebuild --type=article --type=rubric --type=tag
bash
php artisan vendor:publish --tag=webx-blog-views
bash
php artisan vendor:publish --tag=webx-blog-config