DNS = Domain Name System
It's like the phonebook of the internet.
very common problem with large forms:
❌ When you submit a big form and Laravel validation fails, it refreshes the page and shows errors… 😩 But the user has to fill everything again or scroll a lot, which is frustrating.
You do NOT need to re-enter the entire form if you use Laravel’s built-in helpers the right way.
Encapsulation: Bundling data (properties) and methods (functions) that work on the data into a single unit, usually a class. It hides the internal details of the object and only exposes what’s necessary.
Abstraction: Hiding complex implementation details and showing only the necessary features to the user.
Inheritance: The mechanism by which one class can inherit properties and methods from another class, allowing for code reuse and a hierarchical class structure.
Immutable Deep Update using Nested Maps:
When working with nested data structures like arrays of objects (e.g., departments with employees), it's important to update values immutably — without modifying the original data.
This pattern uses nested .map()
functions to update specific fields deep within the structure.
### ✅ You can use `map()` on: | |
1. **An array of values** | |
2. **An array of objects** | |
3. **An array of arrays** | |
Basically, any array. | |
--- | |
### 🔹 1. **Array of values** |