- # Overview
- # Users, Employees & Customers
- # Departments, Roles & Permissions
- # Uploads
- # Backups
- # Blog
- # LA Logs
Overview
A fresh LaraAdmin install has these modules. They are ordinary modules, so you can add fields to them in Module Manager and change their code in app/Http/Controllers/LA/ and resources/views/la/.
| Module | Admin URL | Purpose |
|---|---|---|
| Users | /admin/users | Login accounts (listing and details only) |
| Employees | /admin/employees | Staff who use the admin panel |
| Customers | /admin/customers | Customers, who can register and log in on the site |
| Departments | /admin/departments | Groups of roles |
| Roles | /admin/roles | Roles, their hierarchy and module access |
| Permissions | /admin/permissions | Named permissions given to roles |
| Uploads | /admin/uploads | Media manager |
| Backups | /admin/backups | Database and uploads backups |
| Blog Categories, Blog Posts | /admin/blog_categories, /admin/blog_posts | A small blog shown on the public site |
| LA Logs | /admin/la_logs | Activity log |
The Super Admin also has Modules, Menus and Configure (/admin/la_configs) in the navbar.
Users, Employees & Customers
A User is a login account. Every user belongs to either an Employee or a Customer record (the user's context_type), and has one or more roles.
- Employees are added in the admin panel. Adding an employee creates their user with a random password and the roles you choose. The employee forms can't give the Super Admin role, and editing a Super Admin keeps it.
- Customers register themselves at
/customers/register, or are added in the admin panel. They get theCUSTOMERrole and can't open the admin panel. - Login details are emailed to new users when
MAIL_USERNAMEis set. Otherwise the password is written tostorage/logs/laravel.log. - An employee's password can be changed from their page by the employee themself or by the Super Admin.
- The first user to register at
/registerbecomes the Super Admin. After that,/registerrefuses employee registrations.
Departments, Roles & Permissions
Roles belong to a department and form a hierarchy (Roles → Hierarchy). The seeder creates three roles:
| Role | For | Access |
|---|---|---|
SUPER_ADMIN | Employees | Everything, including Module Manager, Menus, Configure and Backups |
ADMIN | Employees | The admin panel (ADMIN_PANEL permission). Module access must be granted. |
CUSTOMER | Customers | No admin panel |
See Roles & Access Control for module, field and menu access.
Uploads
The media manager, also used by Image, File and Files fields. See Uploads Manager.
Backups
Backups uses spatie/laravel-backup 10. Create Backup makes a zip of the database and storage/uploads. The application code and .env are left out. The settings are in config/backup.php.
- The database dump needs
mysqldumpon the server. - Backups are stored on the disk configured in
config/backup.php(thelocaldisk, i.e.storage/app, by default). Copy them off the server, for example with a scheduledphp artisan backup:runto an S3 disk. - Downloading a backup needs create access to Backups: a backup contains the whole database, including password hashes.
- Failure notifications are mailed to
MAIL_FROM_ADDRESS.
Blog
Blog Categories and Blog Posts are managed in the admin panel and shown on the public site:
| URL | Page |
|---|---|
/blog | Published posts |
/blog/{post_url} | A post. Draft posts return 404. |
/category/{category_url} | Posts of a category |
The /blog prefix is blogRoute in config/laraadmin.php. A post has a title, URL, category, status (Draft / Published), author, tags, date, excerpt, banner image and HTML content.
LA Logs
LA Logs records who did what: users created, updated and deleted, logins and logouts, and the same for employees, customers, uploads, backups and every generated module. Open it at /admin/la_logs; each module's record page also shows its history.
Log types are declared in config/laraadmin.php under log. The CRUD generator adds *_CREATED, *_UPDATED and *_DELETED for each new module. To write your own entry, add a type to the config and call LALog::make():
use App\Models\LALog;
// config/laraadmin.php, under 'log' => 'Courses' => [...]
'COURSE_PUBLISHED' => ['name' => 'Course Published', 'is_notif' => 'false', 'code' => 'COURSE_PUBLISHED', 'module' => 'Courses'],
// in your code
LALog::make('Courses.COURSE_PUBLISHED', [
'title' => 'Course Published',
'module_id' => 'Courses',
'context_id' => $course->id,
'content' => $course,
'user_id' => Auth::user()->id,
'notify_to' => '[]',
]);
Entries with a type that isn't in the config are skipped.