mirror of
https://github.com/archtechx/laravel-pages.git
synced 2025-12-12 01:44:03 +00:00
add source code
This commit is contained in:
commit
e534ddd14c
23 changed files with 798 additions and 0 deletions
36
assets/config.php
Normal file
36
assets/config.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'model' => ArchTech\Pages\Page::class,
|
||||
|
||||
'views' => [
|
||||
/**
|
||||
* The layout used to render the pages.
|
||||
*
|
||||
* @example app-layout For resources/views/app-layout.blade.php
|
||||
* @example layouts.app For resources/views/layouts.app.blade.php
|
||||
*/
|
||||
'layout' => 'app-layout',
|
||||
|
||||
/**
|
||||
* The path to your views.
|
||||
*
|
||||
* @example 'pages.' The package will look into resources/views/pages
|
||||
* @example 'foo::' The package will look into the 'foo' view namespace
|
||||
*/
|
||||
'path' => 'pages.',
|
||||
|
||||
/**
|
||||
* The name of the view used to render markdown pages.
|
||||
*
|
||||
* @example 'pages._markdown' The package will use resources/views/pages/_markdown.blade.php
|
||||
*/
|
||||
'markdown' => 'pages::_markdown',
|
||||
],
|
||||
|
||||
'routes' => [
|
||||
'name' => 'page',
|
||||
'prefix' => '',
|
||||
'handler' => ArchTech\Pages\PageController::class,
|
||||
],
|
||||
];
|
||||
9
assets/views/_markdown.blade.php
Normal file
9
assets/views/_markdown.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<x-dynamic-component :component="config('pages.views.layout')">
|
||||
<div class="w-full flex justify-center my-16 px-4">
|
||||
<div class="prose prose-indigo">
|
||||
<h1>{{ $page->title }}</h1>
|
||||
|
||||
{!! Str::markdown($page->content) !!}
|
||||
</div>
|
||||
</div>
|
||||
</x-dynamic-component>
|
||||
Loading…
Add table
Add a link
Reference in a new issue