Download the PHP package laradium/laradium-content without Composer
On this page you can find all versions of the php package laradium/laradium-content. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laradium-content
Content module for Laradium cms
Installation
For local use
- Add this to your project repositories list in
composer.json
file
Directory structure should look like this
For global use
- Configure
config/laradium.php
file with your preferences - Add widgetConstructor field to you
laradium.php
field list
Usage
By default there comes Main channel with widget constructor, which allows you to create sortable widget blocks for your needs.
Creating new channels
- Run this command (It automatically creates model for you You can pass
--t
argument to also create translations model)
It will create new Channel under App\Laradium\Channels
It should look like this
You need to create model for Blog channel where you can specify all your needed columns and using morphsTo
field type you can add them to you channel
Creating widgets
- Run this command
php artisan laradium:widget
(It automatically creates model for you You can pass--t
argument to also create translations model)
It creates a widget under App\Laradium\Widgets
You can specify your fields under fields
method.
Page resolver
To actually return created pages, you need to add the page resolver route at the end of your routes file, or to your RouteServiceProvider.php
file.
To do this, you can simply use the helper method content()->pageRoute()
, or you can create your own route, but as the resolver route is configurable, there shouldn't be a need for that.
The config file, provides you with some options, to change the behaviour of the page resolver, in case you need some customization.
middlewares
- Change what middlewares the resolver route will usecustom_uri
- Provides you with an option, to define a function name, that will return a custom uriprepend_locale
- Adds an iso code to the uri. So the urlhttps://example.com/my-cool-page
will becomehttps://example.com/en/my-cool-page
uses
- Defines, what controller and method will be used to actually resolve the route.