Add CMS module

Static content pages (CmsPage) manageable from a new Filament resource and
readable via a public API endpoint. Wired into the admin panel with its own
CmsPlugin and "CMS" navigation group.
This commit is contained in:
Nyan Lin Paing
2026-08-30 14:51:57 +07:00
parent 231f5679ef
commit 76f75c5581
26 changed files with 600 additions and 1 deletions
@@ -0,0 +1,28 @@
<?php
namespace Modules\Cms\Http\Controllers;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Routing\Controller;
use Modules\Cms\Http\Resources\CmsPageResource;
use Modules\Cms\Models\CmsPage;
class CmsPageController extends Controller
{
public function index(): AnonymousResourceCollection
{
return CmsPageResource::collection(
CmsPage::query()->where('is_active', true)->paginate()
);
}
public function show(string $page): CmsPageResource
{
$cmsPage = CmsPage::query()
->where('page', $page)
->where('is_active', true)
->firstOrFail();
return new CmsPageResource($cmsPage);
}
}