Overview
Admin controllers handle company-level configuration and user management. All routes require authentication and therole:admin middleware.
Company Management
Manage company profile and settings.View Company Settings
Display company information edit form.
auth, role:admin
Route Name: admin.company.edit
Response:
- Returns view with company details
- Form for editing company information
App\Http\Controllers\Admin\CompanyController@edit
Source: routes/web.php:73
Update Company Settings
Update company information.
auth, role:admin
Route Name: admin.company.update
Request Parameters:
Company name (max 255 characters)
Owner’s full name (max 255 characters)
Owner’s email address (max 255 characters)
Owner’s phone number (max 50 characters)
Company tax ID or VAT number (max 120 characters)
Billing contact email (max 255 characters)
Billing contact phone (max 50 characters)
Street address (max 255 characters)
City name (max 120 characters)
State or province (max 120 characters)
Two-letter country code (ISO 3166-1 alpha-2, e.g., “US”, “MX”)
Postal or ZIP code (max 20 characters)
Three-letter currency code (ISO 4217, e.g., “USD”, “EUR”, “MXN”)
VAT/tax percentage (0-100)
Additional company notes
- Redirects back with success message
UpdateCompanyRequest
Controller: App\Http\Controllers\Admin\CompanyController@update
Source: routes/web.php:74
Worker Management
Manage worker accounts and permissions.List Workers
Display all workers in the company.
auth, role:admin
Route Name: admin.workers.index
Response:
- Returns view with all workers (including soft-deleted)
- Ordered by name
- Only shows workers from admin’s company
App\Http\Controllers\Admin\WorkerController@index
Source: routes/web.php:75
Create Worker
Create a new worker account.
auth, role:admin
Route Name: admin.workers.store
Request Parameters:
Worker’s full name (max 255 characters)
Worker’s email address (max 255 characters, must be unique)
Initial password (minimum 8 characters)
Grant access to billing module (default: false)
Grant access to inventory module (default: false)
- Redirects back with success message
- Worker is automatically assigned to admin’s company
- Worker role is set to “worker”
- Account is active by default
StoreWorkerRequest
Controller: App\Http\Controllers\Admin\WorkerController@store
Source: routes/web.php:76
Update Worker
Update worker account details and permissions.
auth, role:admin
Route Name: admin.workers.update
URL Parameters:
Worker user ID
Worker’s full name (max 255 characters)
Worker’s email address (max 255 characters, unique except for this user)
New password (minimum 8 characters, only if changing password)
Update billing module access
Update inventory module access
- Redirects back with success message
UpdateWorkerRequest
Controller: App\Http\Controllers\Admin\WorkerController@update
Source: routes/web.php:77
Toggle Worker Active Status
Activate or deactivate a worker account.
auth, role:admin
Route Name: admin.workers.deactivate
URL Parameters:
Worker user ID
- Redirects back with success message
- Toggles
is_activestatus - Inactive workers cannot log in
App\Http\Controllers\Admin\WorkerController@deactivate
Source: routes/web.php:78
Delete Worker
Permanently delete a worker account.
auth, role:admin
Route Name: admin.workers.destroy
URL Parameters:
Worker user ID
- Redirects back with success message
- Performs force delete (permanent)
App\Http\Controllers\Admin\WorkerController@destroy
Source: routes/web.php:79
Subscription Management
Manage company subscription plans and settings.View Subscription
Display subscription details and edit form.
auth, role:admin
Route Name: admin.subscription.edit
Response:
- Returns view with subscription details
- If no subscription exists, creates default trial subscription:
- Plan: “starter”
- Status: “trial”
- Duration: 1 month from now
- Billing cycle: “monthly”
- User limit: 10
App\Http\Controllers\Admin\SubscriptionController@edit
Source: routes/web.php:80
Update Subscription
Update subscription plan and settings.
auth, role:admin
Route Name: admin.subscription.update
Request Parameters:
Subscription plan: “starter”, “pro”, “enterprise”, or “developer_test”
Subscription status: “active”, “trial”, “past_due”, “canceled”, or “suspended”
Subscription start date (format: YYYY-MM-DD)
Subscription end date (must be on or after starts_at)
Billing frequency: “monthly” or “yearly”
Maximum number of users allowed (1-100,000)
- Redirects back with success message
UpdateSubscriptionRequest
Controller: App\Http\Controllers\Admin\SubscriptionController@update
Source: routes/web.php:81
Usage Examples
Updating Company Information
Creating a New Worker
Updating Subscription
Deactivating a Worker
Deleting a Worker (Permanent)
Module Access Control
Workers can be granted access to optional modules:- Billing Module (
can_access_billing): Access to invoice/quote generation - Inventory Module (
can_access_inventory): Access to inventory management
module_access middleware on relevant routes.
Example Permission Check: