@elyracode/laravel 0.7.12 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,6 +21,20 @@ Use Laravel tools when:
|
|
|
21
21
|
| `laravel_routes` | Understanding existing routes, middleware, and controllers before adding new endpoints |
|
|
22
22
|
| `laravel_analyze` | Understanding project conventions and patterns before writing any code |
|
|
23
23
|
|
|
24
|
+
## Combining with Database Tools
|
|
25
|
+
|
|
26
|
+
If `@elyracode/db-tools` is installed, use BOTH for full understanding:
|
|
27
|
+
|
|
28
|
+
1. `laravel_models` — shows PHP-side: relationships, fillable, casts, scopes, traits
|
|
29
|
+
2. `db_schema` or database tools — shows DB-side: actual columns, types, indexes, foreign keys
|
|
30
|
+
|
|
31
|
+
Compare the two to find gaps:
|
|
32
|
+
- Columns in DB but not in `$fillable` (may need adding)
|
|
33
|
+
- Columns in `$fillable` but not in DB (missing migration)
|
|
34
|
+
- Columns without `$casts` that should have them (dates, enums, JSON)
|
|
35
|
+
- Missing indexes on foreign key columns
|
|
36
|
+
- Missing foreign key constraints on `_id` columns
|
|
37
|
+
|
|
24
38
|
## Key Principle
|
|
25
39
|
|
|
26
40
|
Run `laravel_analyze` or `laravel_models` BEFORE generating Laravel code. Match the project's existing patterns — if it uses Actions, don't create Services. If controllers are invokable, don't create resource controllers.
|