Introduction
Installing Novus CMS
Novus is a modern headless content management system (CMS) built specifically for Laravel applications. This guide covers essential installation steps and configuration options.
Requirements
Before installing, ensure your environment meets these requirements:
- PHP 8.2 or higher
- Laravel 11.0 or higher
- MySQL 8 or PostgreSQL 10+
- Composer 2.0+
- Node.js 22+ and NPM/Yarn (for frontend assets)
Required PHP extensions:
- ext-fileinfo
- ext-json
- ext-mbstring
- ext-exif (for image processing)
Installation Process
1. Install via Composer
composer require codemystify/novus
2. Run the Installation Command
The simplest way to install Novus is using the built-in installation command:
php artisan novus:prod
This command will:
- Publish configuration files
- Publish database migrations
- Run migrations (with your confirmation)
- Set up frontend assets
- Build the frontend assets
Installation command options:
--force
: Overwrite existing assets or config--no-build
: Skip frontend build process--dev
: Install in development mode
3. Create Admin User
Create your first administrative user:
php artisan novus:create-author
This interactive command will prompt you for name, email, and password details.
Configuration
After installation, you can customize Novus through the published configuration file:
// config/novus.php
return [
// Route configuration
'path' => env('NOVUS_PATH', 'novus'), // URL path prefix
'domain' => env('NOVUS_DOMAIN'), // Optional custom domain
'middleware_group' => [], // Additional middleware
// Storage configuration
'storage_disk' => env('NOVUS_STORAGE_DISK', 'public'), // Disk for media storage
'storage_path' => env('NOVUS_STORAGE_PATH', 'novus-media'), // Path within storage disk
// Access control
'access_control' => \Shah\Novus\Services\Auth\AccessResolver::class,
// Database configuration
'database_connection' => env('NOVUS_DATABASE_CONNECTION', env('DB_CONNECTION', 'mysql')),
// Additional configurations...
];
Database Configuration
By default, Novus uses your application's default database connection (typically MySQL as defined in your .env
file). You can customize this by changing the database_connection
config value:
'database_connection' => env('NOVUS_DATABASE_CONNECTION', 'mysql'),
This allows you to store Novus data in a separate database if needed, which can be useful for larger applications or specific deployment architectures.
Access Control
Novus provides a flexible access control system. By default, any authenticated Novus user has access to the admin panel. You can customize this behavior by implementing your own access control class:
- Create a custom access resolver:
namespace App\Services;
use Illuminate\Contracts\Auth\Authenticatable;
use Shah\Novus\Contracts\Accessible;
class CustomAccessResolver implements Accessible
{
public function canAccess(?Authenticatable $user = null): bool
{
if (!$user) {
return false;
}
// Your custom logic here
// For example, only allow specific emails
return str_ends_with($user->email, '@yourcompany.com');
// Or check for specific roles
// return $user->hasRole('admin') || $user->hasRole('editor');
}
}
- Register your custom resolver in the config file:
'access_control' => \App\Services\CustomAccessResolver::class,
This allows you to implement complex authorization rules based on your application's needs.
Middleware Configuration
Novus allows you to add custom middleware to all admin routes through the middleware_group
configuration:
'middleware_group' => ['web', 'track-admin-activity', 'log-actions'],
This is useful for:
- Adding activity logging
- Implementing custom authorization
- Setting specific headers for admin routes
- Adding monitoring or debugging middleware
By default, Novus applies the base middleware ['web', HandleInertiaRequests::class]
and then appends any middleware you specify in this configuration.
Pagination Settings
Throughout the Novus admin panel, pagination is used to display lists of data. You can control the default number of items per page by setting the appropriate values in the config/novus.php
file:
'items_per_page' => env('NOVUS_PER_PAGE', 10),
Storage Setup
Novus uses Laravel's storage system for media files. By default, it uses the public
disk.
- Ensure your disk is properly configured in
config/filesystems.php
- Create a symbolic link to make the media files accessible:
php artisan storage:link
For S3 or other storage drivers, update the novus.storage_disk
configuration accordingly.
Frontend Development
For local development with hot reloading:
php artisan novus:dev
This command creates the necessary symlinks and prepares your environment for frontend development.
Accessing the CMS
After installation, access your Novus CMS at:
https://your-app.com/novus
Login using the credentials created with the novus:create-author
command.
Customizing the access URL:
// For custom path
'path' => 'admin', // https://your-app.com/admin
// For custom domain
'domain' => 'admin.your-app.com',