chadanuk/mini-cms

Small, block based CMS

dev-master 2022-02-21 18:30 UTC

This package is auto-updated.

Last update: 2024-04-27 01:28:43 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

Templates based on page slug name, multiple Markdown and string blocks per page.

Define the content blocks in the template and Mini Cms will pick them up an present them as fields in the admin.

Installation

You can install the package via composer:

composer require chadanuk/mini-cms

Add the following to your services providers in config/app.php

'providers' => [...
    Chadanuk\MiniCms\MiniCmsServiceProvider::class,
    Chadanuk\MiniCms\MiniCmsAdminRouteServiceProvider::class,
    ...
];

And at the bottom of all the providers add the catch all cms provider...

'providers' => [...
    Chadanuk\MiniCms\MiniCmsRouteServiceProvider::class,
];

Add the following to your aliases in config/app.php

'aliases' => [
    'MiniCms' => Chadanuk\MiniCms\MiniCmsFacade::class,
];

Usage

To use the blocks on a template (named after the page slug) in resources/views/vendor/mini-cms/templates/{page-slug}.blde.php

<h1>@minicms('string', 'Title')</h1>

<h2>@minicms('string', 'Subtitle')</h2>

@minicms('markdown', 'Content')

To embed the minicms admin pages in a custom view you will need to remove the admin route and use the following in your view...

\MiniCms::renderAdmin()

You will also need to add a route that catches the minicms paths, so something like...

Route::any('admin/mini-cms/{path?}', '\App\Http\Controllers\Admin\CMSController@show')->name('admin.cms')->where('path', '.*');

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email chadanuk+minicms@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.