Cole is a multi-tenant school management API built on Laravel 9. Before any school can start managing periods, grades, or attendance, you need to configure the environment, run migrations, seed the required roles and modules, and create your first super-admin account. This guide walks through every step in the correct order.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iamalexis689725/cole/llms.txt
Use this file to discover all available pages before exploring further.
Environment Configuration
Copy.env.example to .env and fill in the required values. The most critical sections are described below.
Application Keys
Database
Cole requires a MySQL database. Create the database first, then configure the connection:Filesystem and Storage
Cole uses the filesystem to store tenant logos and agenda file attachments uploaded via the API. TheFILESYSTEM_DISK variable controls which driver is used.
Queue Driver
Cole dispatches background jobs for certain operations. The defaultsync driver processes jobs inline within the request, which is fine for development. In production, use a real queue backend so the HTTP request returns immediately.
redis, also set:
Running Migrations
With the database credentials in place, run all migrations to create Cole’s schema:Seeding Roles and Modules
Cole’s authorization system depends on a fixed set of roles (managed by Spatie Laravel Permission) and a catalogue of optional feature modules. Both must be seeded before any users can be created.DatabaseSeeder, which calls both in the correct order:
RoleSeeder:
| Role | Description |
|---|---|
super-admin | Manages tenants (schools) across the entire platform |
director | Manages a single school: periods, courses, teachers, students |
profesor | Records grades, attendance, and agenda items for assigned classes |
estudiante | Students enrolled in courses |
padre | Parents/guardians who monitor their children’s activity |
ModuleSeeder:
| Code | Name |
|---|---|
agenda | Academic Agenda (tasks and assignments) |
asistencia | Attendance |
circulares | School Circulars |
anecdotario | Anecdotal Records |
biblioteca | Library |
estudiantes | Students |
Modules are activated per-tenant by a
super-admin via PATCH /api/tenants/{tenantId}/modules/{moduleId}/activate. A tenant only has access to the features whose modules are active.Storage Symlink
WhenFILESYSTEM_DISK=public, Laravel serves uploaded files through the public/storage directory. Create the symlink with:
public/storage → storage/app/public. After this, uploaded tenant logos and agenda file attachments are reachable at https://api.yourschool.com/storage/{path}.
CORS Configuration
Cole’s CORS policy lives inconfig/cors.php. The default configuration allows all origins, methods, and headers — suitable for development:
Creating the First Super-Admin
Thesuper-admin role is responsible for provisioning new school tenants. Create the first super-admin account by registering through the API and then assigning the role directly in the database (or via Tinker), since no director exists yet to delegate that action.
Register a user:
Authorization: Bearer <token> on all subsequent requests.
Creating a Tenant (School)
With the super-admin token, provision a new school tenant:super-admin can then activate modules for that tenant:
director user can be created for that school and the academic structure can be built. Continue to the Academic Structure guide.