You built a SaaS. Users signed up. Now you need to actually manage them. And "manage" means a lot more than a table with an edit button.
I built Kohana.io - a production CRM/ERP for small businesses. The admin user management module turned out to be one of the most complex pieces in the system. Now I'm extracting it into LaraFoundry , an open-source SaaS framework for Laravel.
This post covers the full implementation: CRUD, banning, impersonation, activity logging, and search/filtering.
Table of Contents
CRUD Architecture
Ban System
Impersonation ("Follow")
Activity Logging
Search & Filtering
Testing
Design Decisions
CRUD Architecture
Create
User creation goes through AdminUserStoreRequest - validation happens before the controller.
Validated fields:
Required: name , email , password (with confirmation)
Optional: lastname , middlename , phone , sex , country , birth_date
Social links: array validation - URL must be valid, social network must exist in config
Password handling:
// User modelβ¦