Load relations without N+1 queries
HasMany, HasOne, BelongsTo, and BelongsToMany describe connections. with() groups eager loading to avoid issuing one additional query for every parent record.
$posts = $context->set(Post::class)
->with('author', 'comments')
->all();
aml data:migrate --connection main
aml data:seed --connection mainEvolve schemas with migrations
Schema and Table express portable changes. Migration locks prevent two processes from applying the same version concurrently, and failures identify both the migration and direction.
Create repeatable data and useful diagnostics
Seeders run transactionally and should create deterministic development or reference data. data:doctor reports drivers, connection, server version, transactions, savepoints, returning, and foreign-key support without printing passwords.