Commands
Botble CMS provides a variety of Artisan commands to help you manage your application. This page lists all available commands and their usage.
Command Categories
- Installation & Setup
- User Management
- Asset Management
- Plugin Management
- Theme Management
- Widget Management
- Database Management
- System Maintenance
- Backup & Restore
- Logging & Monitoring
- Miscellaneous
Installation & Setup
CMS Installation
Installs the CMS by running migrations, creating a super user, activating plugins, and publishing assets.
php artisan cms:install
This interactive command will:
- Run database migrations
- Optionally create a super user
- Optionally activate all plugins
- Optionally seed the database with sample data
- Publish assets
Create Admin User
Creates a new administrator user account.
php artisan cms:user:create
The command will prompt you for:
- First name
- Last name
- Username
- Password
After creating the user, you can log in at /admin
with the credentials you provided.
Publish Assets
Copies assets from the /platform
directory to make them accessible in the public directory.
php artisan cms:publish:assets
This command publishes:
- Core assets to
/public/vendor/core
- Plugin assets to
/public/vendor/core/plugins/{plugin}
- Theme assets to
/public/themes/{theme}
Package Management
Create a Package
Creates a new package in the /platform/packages
directory.
php artisan cms:package:create <package>
Note: After creating a package, you need to add it to your composer.json
file and run composer update
to load it.
Plugin Management
Create a Plugin
Creates a new plugin in the /platform/plugins
directory with the basic structure.
php artisan cms:plugin:create <plugin>
This command generates a complete plugin structure including:
- Controllers
- Models
- Routes
- Views
- Migrations
- Language files
- Service provider
Activate a Plugin
Activates an existing plugin.
php artisan cms:plugin:activate <plugin>
This command:
- Adds the plugin to the list of activated plugins in the
settings
table - Runs migrations to update the database
- Clears the application cache
Activate All Plugins
Activates all plugins in the /platform/plugins
directory.
php artisan cms:plugin:activate:all
Deactivate a Plugin
Deactivates an existing plugin.
php artisan cms:plugin:deactivate <plugin>
This command:
- Removes the plugin from the list of activated plugins in the
settings
table - Clears the application cache
Deactivate All Plugins
Deactivates all plugins in the /platform/plugins
directory.
php artisan cms:plugin:deactivate:all
Remove a Plugin
Completely removes an existing plugin.
php artisan cms:plugin:remove <plugin>
This command:
- Deactivates the plugin
- Removes the plugin's assets
- Drops the plugin's database tables
- Deletes the plugin directory
Remove All Plugins
Removes all plugins from the /platform/plugins
directory.
php artisan cms:plugin:remove:all
List Plugins
Displays a list of all plugins and their activation status.
php artisan cms:plugin:list
Publish Plugin Assets
Publishes assets for all or specific plugins.
php artisan cms:plugin:assets:publish [plugin]
Discover Plugins
Rebuilds the plugin manifest cache.
php artisan cms:plugin:discover
Theme Management
Create a Theme
Creates a new theme in the /platform/themes
directory.
php artisan cms:theme:create <theme>
This command generates a complete theme structure with all necessary files and directories.
Activate a Theme
Sets a theme as the active theme for your site.
php artisan cms:theme:activate <theme>
This command updates the active theme in the settings and clears the cache.
Remove a Theme
Completely removes a theme from the system.
php artisan cms:theme:remove <theme>
Note: You cannot remove the currently active theme. You must activate another theme first.
Publish Theme Assets
Copies theme assets to the public directory to make them accessible.
php artisan cms:theme:assets:publish [theme]
If no theme name is provided, it publishes assets for the currently active theme.
Remove Theme Assets
Deletes published theme assets from the public directory.
php artisan cms:theme:assets:remove [theme]
Install Theme Sample Data
Imports sample data for a theme.
php artisan cms:theme:install-sample-data
This command imports the SQL file located at platform/themes/your-theme/data/sample.sql
.
Check Theme Options
Checks for differences between theme options in the database and option definitions.
php artisan cms:theme:options:check
Widget Management
Widgets are always associated with a theme and are located within the theme directory.
Create a Widget
Creates a new widget in the current active theme.
php artisan cms:widget:create <widget>
This command creates a widget in /platform/themes/your-theme/widgets
and automatically registers it in the registration.php
file.
Remove a Widget
Removes an existing widget from the current active theme.
php artisan cms:widget:remove <widget>
Database Management
Export Database
Exports the database to an SQL file.
php artisan cms:db:export [output]
By default, the database is exported to database.sql
in the root directory. You can specify a different output path as an argument.
Import Database
Imports a database from an SQL file.
php artisan cms:db:import [file]
By default, the command looks for database.sql
in the root directory. You can specify a different file path as an argument.
Change Slug Prefix
Changes or sets the prefix for slugs of a specific model.
php artisan cms:slug:prefix <class> --prefix=<prefix>
Example:
php artisan cms:slug:prefix "Botble\\Blog\\Models\\Post" --prefix="blog"
System Maintenance
Clean Up System
Cleans up the database by removing unnecessary data while preserving essential records.
php artisan cms:system:cleanup
Warning: This command will delete most data from the database. Use with caution and only when you want to reset your system.
Clear Expired Cache
Removes expired cache items from the system.
php artisan cms:cache:clear-expired
Compress Images
Compresses images to reduce file size without significant quality loss.
php artisan cms:media:compress
Fetch Google Fonts
Downloads Google Fonts for local hosting.
php artisan cms:google-fonts:fetch
Update Google Fonts
Updates the list of available Google Fonts.
php artisan cms:google-fonts:update
Backup & Restore
Create Backup
Creates a backup of the database and uploaded files.
php artisan cms:backup:create [name] --description=[description]
Restore Backup
Restores a backup from a specific date or the latest backup.
php artisan cms:backup:restore [backup-date]
If no date is provided, it restores the latest backup.
List Backups
Displays a list of all available backups.
php artisan cms:backup:list
Remove Backup
Deletes a specific backup.
php artisan cms:backup:remove [backup-date]
Clean Backups
Removes all backups from the system.
php artisan cms:backup:clean
Logging & Monitoring
Clear Log Files
Deletes all log files from the storage/logs
directory.
php artisan cms:log:clear
Clear Activity Logs
Deletes all activity logs from the database.
php artisan cms:activity-logs:clear
Clean Old Activity Logs
Removes activity logs older than 30 days.
php artisan cms:activity-logs:clean-old-logs
Clear Request Logs
Deletes all request error logs from the database.
php artisan cms:request-logs:clear
Miscellaneous
Activate License
Activates your Botble CMS license.
php artisan cms:license:activate <license-key>
Update CMS
Updates the CMS to the latest version.
php artisan cms:update
This command:
- Downloads the latest version
- Extracts the files
- Updates the core and packages
- Runs migrations
- Publishes assets