Download the PHP package niku-solutions/cms without Composer
On this page you can find all versions of the php package niku-solutions/cms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download niku-solutions/cms
More information about niku-solutions/cms
Files in niku-solutions/cms
Package cms
Short Description A codeable and flexible custom post type manager for Laravel with custom fields. Extendable and as dynamic as you wish.
License MIT
Informations about the package cms
Laravel Post Manager
A API based codeable post manager for Laravel with custom fields. Extendable as you wish. Based on the API request, you will receive the post type configurations in a way where you can build your front-end with. We will take care of the CRUD functionality with support of taxonomies, media management and post meta.
We use our package internally in our projects to remove the need of basic post management. We are now able to setup advanced dashboard functionality for all type of post data like Pages, Posts, Products and whatever post type or category you require. You can add or remove custom fields in no time with no need to touch the database as the package does that automatically for you and save the data and shows it to you when displaying the editting form.
We are working on a decoupled front-end package in Vue.js and Axios which makes it possible to interact with the API in your Laravel project or Single Page Application.
Features
- Custom post types
- Configuration pages
- Taxonomies like categories
- Media manager with upload functionality and management
- Repeating custom field groups
- Custom fields
- Validation rules for custom fields
- Conditional custom fields based on template selection
- Easy default user authentication based on if a user is logged in
- Possibility to let users only view their own posts
- Menu management support, you will need our front-end package for that.
Installation
Install the package via composer:
Register the following class into the 'providers' array in your config/app.php
Register the following middleware to whitelist your post types and config groups in the route files. You dont have to do anything further with this as we use this in our provider to secure the api routes of the post manager.
You need to run the following artisan command to publish the required config file to register your post types.
If you run the following vendor publish, you will receive a example set of post types to use
Migrate the database tables by running:
Usage
Before you are able to use the post types, you need to whitelist and setup the required custom fields and templates in the config/niku-cms.php file.
You can register the routes by pasting the following method in your route file. You can add middlewares like you would normally do to secure the routes with authentication etc. The post_type in the registed routes are variable but secured by a parameter in the method, so by default no api requests are enabled.
To enable the API routes, you need to register the names of the post types you would like to use as you see in the 'register_post_types' array key below. When registering a post type, you fill in the name of the array key in the config/niku-cms.php file. For more information about the config, read on.
If you for example have 2 user roles which have to communicate to the same post type but require different permissions, you can create 2 config files where the normal user account can only view their own posts, and the superadmin can view all of the users their posts. You do that by naming the array key of the config/niku-cms.php unique and creating 2 config files where the '$identifier' is pointed to the same 'post_type'.
For each post type registered, you can set up default data and custom fields. You can add validations to the validation array key of the custom field you insert. All Laravel validation rules will be supported as it will only pass it thru to the validator class.
Do you want to change the custom fields displayed based on the template? You can add multiple views which are selectable in the frontend for the end user and change the visible custom fields.
Blog
If you want a blog like method, you can do the following.
Enable the following type in your routes/web.php.
Next you enable the required methods in the controller.
And then in your view, you do the following. This syntax will be recreated in the future to make it more fluent but for now it works.
Switching templates
If you have enabled more than 1 post type template in the config/niku-cms.php, you will see a option appear in the backend to switch between templates. When you have selected one template, you can switch views in the frontend like this.
API
To retrieve the base structure of your post type, you can request the following post API where the value is 0. This means we creating a new post. The result of this request will give you the structure of what you have inserted in the config file. With this data you can build the front-end of your page to automaticly create the input fields of the create form.
You will trigger this API on initialisation of the page where you want to create a new post item. (/superadmin/pages/create).
Extending the custom fields and defining your own
You can create your own custom fields by using the registered component identifier to identify which Vue component you need to show. This information will be attached to the API request when requesting the following API;
Registrate your component with they key you define in the post type config.
And for example use the following code structure
Security Vulnerabilities
If you find any security vulnerabilities, please send a direct e-mail to Nick Kuijpers at [email protected].
License
The MIT License (MIT). Please see MIT license for more information.
All versions of cms with dependencies
illuminate/http Version ^5.2
illuminate/auth Version ^5.2
illuminate/database Version ^5.2
illuminate/support Version ^5.2