PHP code example of antlur / phatsby-starter

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

    

antlur / phatsby-starter example snippets


// routes.php
Route::get('/blog/{post}', [BlogController::class, 'show']);

// app/Http/Controllers/BlogController.php
use Capo\Attributes\ExportPaths;

class BlogController
{
    #[ExportPaths(BlogPostPaths::class)]
    public function show(string $name)
    {}
}

class BlogPostPaths implements \Capo\Services\Export\Interfaces\ExportPaths
{
    public function paths(): array
    {
        return [
            '/blog/first-post',
            '/blog/second-post',
        ];
    }
}
bash
/pages
├── index.blade.php
├── about.blade.php
├── about (nested index also works)
│   └── index.blade.php