Download the PHP package fbollon/lara-cms-lite without Composer
On this page you can find all versions of the php package fbollon/lara-cms-lite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fbollon/lara-cms-lite
More information about fbollon/lara-cms-lite
Files in fbollon/lara-cms-lite
Package lara-cms-lite
Short Description Content management system lite for Laravel app
License MIT
Homepage https://github.com/fbollon/lara-cms-lite
Informations about the package lara-cms-lite
Lara CMS Lite
A lightweight content management package for Laravel applications.
Lara CMS Lite allows authorized users to add and manage content on predefined pages of a Laravel application. It is especially useful for intranet and business applications where selected text must be updated without modifying the application's source code.
The package can also be used to add simple news or blog-style content to an existing application.
Requirements
- PHP 8.2 or later
- Laravel 11 or 12
- Bootstrap 4 or Bootstrap 5 when using the package views without customization
The package provides ready-to-use views for Bootstrap 4 and Bootstrap 5.
Bootstrap is only required when using these views without customization. Applications that do not use Bootstrap can publish the package views and adapt their markup and styles to their own front-end framework.
Installation
Install the package with Composer:
Run the migrations:
A contents table will be created. If your application already contains a table with this name, publish the package configuration and change the table value in config/lara-cms-lite.php.
Configuration
Publish the package configuration:
The configuration file will be published to:
Review the available options and adjust them to match your application.
Bootstrap version
The package provides ready-to-use views for Bootstrap 4 and Bootstrap 5.
Bootstrap is only required when using the provided views without customization. Applications that do not use Bootstrap can publish the package views and adapt their markup and styles to their own front-end framework.
Set the Bootstrap version used by the package in your application's .env file:
Supported values are:
4for Bootstrap 4 views5for Bootstrap 5 views
After changing the Bootstrap version, clear Laravel's configuration cache:
To publish the package views:
The published views can then be customized from:
To overwrite previously published views, use the --force option:
Warning: The
--forceoption overwrites existing published views. Back up or compare your customized views before running this command.
Bootstrap dependency
Lara CMS Lite does not install or load Bootstrap. The host application must already include the Bootstrap CSS and JavaScript corresponding to the version selected in the package configuration.
If the host application does not use Bootstrap, publish the package views and adapt their markup and CSS classes to the front-end framework or custom styles used by the application.
TinyMCE
TinyMCE is loaded from the jsDelivr CDN by default. It is no longer installed or published through Composer.
Default URL:
You can override this URL in the application's .env file, for example to use another CDN or a locally hosted copy:
After changing the URL, clear Laravel's configuration cache:
If the package configuration was previously published, make sure config/lara-cms-lite.php contains the current tinymce_url setting.
Publishing views
Publishing the views is optional. The application uses the views included in the package by default.
Publish the views only when you need to customize them or when the host application does not use Bootstrap:
The views will be published to:
Published views override the views included in the package. Once published, future package view updates are not applied automatically to the application.
To overwrite previously published views, use the --force option:
Warning: --force overwrites any custom changes made to the published views. Back up or compare customized files before running this command.
Authorization
Add a canManageLaraCmsLiteContent() method to your application's user model and implement the authorization logic required by your application:
For example, you can check a role or another property:
Define the lara-cms-lite-manage gate in your application's authorization configuration:
Replace the sample logic with the appropriate roles or permissions for your application.
Usage
Visit the following URL to create and manage content:
Display content in an existing view
Add the following code where the contextual content should be displayed:
In each controller method that displays managed content, import the Content model, retrieve the contextual content, and pass it to the view:
Updating
Update the package and its related dependencies with:
Then clear the application caches and run pending migrations:
If the views were published and the package provides updated views, compare the package views with the customized application views before republishing them.
Changelog
Please see CHANGELOG.md for information about recent changes.
Contributing
Please see CONTRIBUTING.md for details.
Security
If you discover a security vulnerability, please report it privately to the package maintainer instead of opening a public issue.
Credits
- Frédéric Bollon
- All Contributors
License
The MIT License. Please see LICENSE.md for more information.
Laravel Package Boilerplate
This package was generated using Laravel Package Boilerplate.