Make Page Command
The make:page command allows you to create a new page - including page data class and content file.
1
php artisan make:page Post --collection=blog
Copied!
This command will create the following two files.
app/Pages/Post.php
resources/content/blog/post.md
1
<?php
2
​
3
namespace App\Pages;
4
​
5
use Astrotomic\Stancy\Models\PageData;
6
use Astrotomic\Stancy\Traits\PageHasContent;
7
use Astrotomic\Stancy\Traits\PageHasDate;
8
use Astrotomic\Stancy\Traits\PageHasOrder;
9
use Astrotomic\Stancy\Traits\PageHasSlug;
10
​
11
class Post extends PageData
12
{
13
​
14
}
Copied!
1
---
2
_pageData: \App\Pages\Post
3
_view: null
4
---
Copied!
After this you can rename the created markdown file, add the view to use and your content.
The make:page command works with sheet collections with markdown, JSON or YAML content (.md, .json, .yaml, .yml). For all other extensions it will only create an empty file.
​
Last modified 2yr ago
Copy link