Installation
Requirements
- PHP ^8.2
- MySQL 5.7+ / MariaDB 10.2.7+
- Laravel 11, 12, or 13
- Livewire 3 or 4
Install Laravel CRM
Step 1. Require the Package
composer require venturedrake/laravel-crm
Step 2. Run the Installer
The installer publishes config, migrations, and assets, runs migrations, seeds the database, and creates your initial owner user:
php artisan laravelcrm:install
The installer will:
- Publish the configuration file to
config/laravel-crm.php - Publish database migrations
- Publish frontend assets to
public/vendor/laravel-crm/ - Run migrations (creates all
crm_-prefixed tables) - Seed default data (roles, permissions, pipeline stages, settings)
- Patch your
Usermodel with theHasCrmAccessandHasCrmTeamstraits (it prompts first, and skips if they are already there) — see Users → Setup - Add
@php artisan laravelcrm:upgrade --ansito yourcomposer.jsonpost-autoload-dumpscripts — see The composer hook - Prompt you to choose which optional modules to enable — the 13 entries listed under Optional Modules: leads, deals, quotes, orders, invoices, deliveries, purchase-orders, teams, chat, email-marketing, sms-marketing, features, monitoring
- Prompt you to create an owner user (or grant access to an existing user)
For non-interactive installs you can pre-select modules:
# Enable everything
php artisan laravelcrm:install --modules=all
# Enable a specific subset
php artisan laravelcrm:install --modules=leads,deals,quotes,invoices
Step 3. Access the CRM
Navigate to http://<yoursite>/crm (or whatever you set LARAVEL_CRM_ROUTE_PREFIX to). Log in with the owner credentials you created during installation.
The composer hook
The installer writes this into your application's composer.json:
"scripts": {
"post-autoload-dump": [
"@php artisan package:discover --ansi",
"@php artisan laravelcrm:upgrade --ansi"
]
}
From then on, every composer install and composer update republishes CRM assets and clears cached config, routes and views on its own — including a production composer install --no-dev. laravelcrm:upgrade never opens a database connection and never prompts, so it is safe to run unattended mid-build.
The line must come after package:discover; that is what makes the package's artisan commands resolvable. If the installer could not edit the file it prints the line for you to add by hand. See Updates.
Additional Setup Commands
After installation, you can run these optional commands from your host application:
# Republish assets and clear caches — no database access, safe unattended
php artisan laravelcrm:upgrade
# Apply migrations, seed data and run backfills after a package update
php artisan laravelcrm:update
# Add another user with CRM access
php artisan laravelcrm:add-user
# Generate sample data for development
php artisan laravelcrm:sample-data
See the Upgrade Guide for what laravelcrm:upgrade and laravelcrm:update each do and where they belong in a deploy.
Localisation
The package ships en, plus en_au and en_gb regional override files and a Persian (fa) translation. See Configuration → Localisation for what each covers and where fa currently falls back to English.
Route Prefix
By default, the CRM is accessible at /crm. To change this, set the LARAVEL_CRM_ROUTE_PREFIX environment variable or update config/laravel-crm.php.
If you set the route prefix to blank (serving from root), update your routes/web.php to avoid conflicts with the CRM's routes:
Route::middleware(['auth'])->get('/dashboard', function () {
return redirect('/');
})->name('dashboard');
Field Encryption
To encrypt sensitive database fields (names, emails, phones) after installation:
php artisan laravelcrm:encrypt
To decrypt them later:
php artisan laravelcrm:decrypt
Enable encryption in your .env:
LARAVEL_CRM_ENCRYPT_DB_FIELDS=true