write(type: tariff_type::endless); echo "Created the tariff ($tariff)"; // Creating the code $code = new code()->write(code: 'admin', tariff: $tariff); echo " for the created code ($code)"; // Search for the created code $created = new code()->read( filter: fn(record $record) => $record->identifier === $code, ); if ($created instanceof code) { // Found the created code echo ": $created->value\n"; } else { // Not found the created code echo "\n"; } }