Installing

Prerequisites

Before beginning installation, ensure your environment meets the system requirements.


Standard Installation

Step 1: Create a Laravel Application

You can install InspireCMS on a new Laravel application or an existing one:

# Create a new Laravel application
composer create-project laravel/laravel my-inspirecms-project
cd my-inspirecms-project

Step 2: Configure Your Database

Update your .env file with your database credentials:

.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_database_password

Step 3: Install InspireCMS

Add InspireCMS to your project:

composer require solution-forest/inspirecms-core

Step 4: Run the Install Command

The installer will set up the database, publish assets, and configure InspireCMS:

php artisan inspirecms:install

Step 5: Access the Admin Panel

After installation, you can access the admin panel at /cms (or your configured path) and create your first admin user.

Step 6: Remove Default Welcome Route (New Projects Only)

If you're working with a new Laravel application, remove the default welcome route from routes/web.php:

<?php

use Illuminate\Support\Facades\Route;

// Remove or comment out this line:
// Route::get('/', function () {
//     return view('welcome');
// });

\SolutionForest\InspireCms\Facades\InspireCms::routes();

This allows InspireCMS to handle your site's routing properly.

Step 7: Set Up Queue Workers and Scheduled Jobs

InspireCMS requires queue workers and scheduled jobs for image conversion, background processing, and other essential operations.

For development, you can run these commands manually in separate terminals:

  • php artisan queue:work (for background jobs)
  • php artisan schedule:work (for scheduled tasks)

For detailed configuration options, refer to the Laravel Queue documentation and Task Scheduling documentation.


Manual Installation Steps

If you need more control over the installation process, follow these steps:

  1. Install required packages:
php artisan inspirecms:install-require-packages
  1. Publish configuration, migrations, and assets:
php artisan vendor:publish --tag="inspirecms-config"
php artisan vendor:publish --tag="inspirecms-migrations"
  1. Run migrations:
php artisan migrate
  1. Publish panel:
php artisan inspirecms:publish-panel
  1. Import default data:
php artisan inspirecms:import-default-data
  1. Repair permissions:
php artisan inspirecms:repair-permissions

Creating Your First Content

  1. Log in to the admin panel at /cms
  2. Navigate to Settings > Document Types
  3. Click "Create" to add a new document type (e.g., "Blog Post")
  4. Add custom fields to your document type
  5. Navigate to Content > Pages
  6. Click "Create" to add new content using your document type

For detailed information about creating and configuring document types, see the Document Types documentation.


Setting Up Your Frontend

  1. Create a blade template in resources/views/components/inspirecms/your-theme/page.blade.php

  2. Use the @property directive to access your content fields:

@props(['content', 'locale' => null])
@aware(['isPreviewing'])
<html>
    <head>
        <title>{{ $content->getTitle() }}</title>
    </head>
    <body>
        <h1>@property('hero', 'title')</h1>
        <div class="content">
            @property('content', 'body')
        </div>
    </body>
</html>
  1. Navigate to Settings > Document Types > Templates to assign your template to content
@props(['isPeekPreviewModal' => false])
@php
    $locale ??= $content->getLocale();
@endphp
<x-cms-template type="page" :content="$content" :locale="$locale" :isPreviewing="$isPeekPreviewModal">
// Adding content here
</x-cms-template>

For detailed information about creating frontend layouts and templates, see the Custom Fields documentation and Frontend Layouts documentation.


Troubleshooting Common Issues

Permissions Issues

If you encounter permission issues, ensure your web server has appropriate access:

# For Ubuntu/Debian
chmod -R 775 storage bootstrap/cache
chown -R $USER:www-data storage bootstrap/cache

Database Connection Issues

If you're having trouble connecting to your database, verify your .env configuration and ensure the database exists.

Package Discovery Problems

If Laravel isn't discovering the package, try clearing your cache:

php artisan config:clear
php artisan cache:clear
Previous
Next