This version introduces the first functional iteration of the personal data flow and prepares the application for psychological tests.
- Dashboard results flow:
- Loader overlay shows “Analizando respuestas” for ~7 seconds after submission.
- Results modal opens automatically and lists items as “Factor: {index}_Sten: {value}”.
- Results are passed via session(
results
) from the controller.
- Test cards behavior:
- If a test status is
completed
(model or pivot), card renders without link and shows a green “Completed!” badge. - Pending tests remain clickable and show the questions counter.
- If a test status is
- Scoring pipeline:
- Aggregation by factor name across answers; total score per factor calculated server-side.
- Database function
lookup_sten
used to compute Sten; result normalized and returned to UI.
- Database & migrations:
- Migration to create SQL function
lookup_sten
added. - Collation migration to utf8mb4_unicode_ci (IMPLICIT) applied across database/tables where needed.
- Migration to create SQL function
- Controllers:
TestController@questionarieSubmit
builds theresults
array grouped by factor and flashes it to session.DashboardController@index
loads user tests via pivot to expose status for UI rendering.
- Profile page enhancements:
- Always-visible Personal Data form (create/update unified) with validation and English translation.
- Conditional tests widgets section (Available Tests & Completed Tests) shown when user has personal data; auto-scrolls into view on load.
- Red alert + warning icon when middleware redirects user without personal data (inputs highlighted).
- Middleware:
EnsureUserHasPerson
forces users to complete personal data before navigating the app. - Authentication flow adjustments:
- Registration assigns default
user_level_id = 3
(user level). - Post-login & post-registration redirect to profile instead of dashboard.
- Registration assigns default
- Person management:
- Backend create & update endpoints (
person.store
,person.update
). - Form supports gender options (male, female, other) and unified UX.
- Backend create & update endpoints (
- UI components:
- Tests overview widgets (hardcoded demo data) with modern Tailwind styling.
- Language & UX:
- Personal Data form fully translated to English.
- Consistent status flash keys (
person-updated
,person_required
).
- Seeders added/improved:
- User levels (
super_admin
,admin
,user
). - Super admin user (
SuperAdminUserSeeder
) with default credentials. - Interpretation data bulk insert.
- Sten age data bulk insert.
- User levels (
- Eloquent relationships defined across models (User, Person, Question, Test, etc.).
- Routing & bootstrap configuration updated to register custom middleware in web group (
bootstrap/app.php
). - Codebase cleanup & structural alignment for Laravel 12 style configuration.
The Laravel framework is open-sourced software licensed under the MIT license.
Follow these steps to set up the application:
-
Clone the Repository:
git clone <repository-url> cd project_name
-
Install Dependencies:
composer install npm install npm run build
-
Set Up Environment Variables:
- Copy the
.env.example
file to.env
:cp .env.example .env
- Update the
.env
file with your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_username DB_PASSWORD=your_password
- Copy the
-
Generate Application Key:
php artisan key:generate
-
Run Migrations:
php artisan migrate --seed
-
Login with Super Admin (seeded):
- Email:
superadmin@example.com
- Password:
password
(change immediately in production).
- Email:
-
Start the Development Server:
php artisan serve
Your application should now be running at http://localhost:8000.