User Interface
Reference
- Activity
- Addresses
- Calls
- Chat
- Custom Field Groups
- Custom Fields
- Customers
- Deals
- Deliveries
- Email Marketing
- Files
- Invoices
- Labels
- Lead Sources
- Leads
- Lunches
- Meetings
- Notes
- Orders
- Organisations
- People
- Permissions
- Pipelines
- Product Attributes
- Product Categories
- Products
- Purchase Orders
- Quotes
- Roles
- SMS Marketing
- Tasks
- Tax Rates
- Teams
- Users
Roles
Overview
Roles extend Spatie Permission to provide role-based access control within the CRM. CRM-specific roles are distinguished from application roles via the crm_role flag.
Model: VentureDrake\LaravelCrm\Models\Role
Extends: Spatie\Permission\Models\Role
Default Roles
The CRM ships with the following default roles:
- Owner — Full access to all CRM features
- Admin — Administrative access
- Manager — Management-level access
- User — Standard user access
Scopes
crm
Filters to only CRM roles.
$roles = Role::crm()->get();
crmNotOwner
Filters to CRM roles excluding the Owner role (useful for role assignment dropdowns).
$roles = Role::crmNotOwner()->get();
Usage
use VentureDrake\LaravelCrm\Models\Role;
// Get all CRM roles
$roles = Role::crm()->get();
// Assign a role to a user
$user->assignRole('Admin');
// Check role
$user->hasRole('Owner');
Seeding Roles
php artisan laravelcrm:permissions