Object (Instance): A single instance created from a class. If User is the class, the user Alice (with her specific email and name) is an object. An object is one specific instance created from a class. If Customer is the class, then the customer "Bakkerij Jansen" with its own address and order history is an object.
Frequently asked questions about Object (Instance)
How is Object (Instance) used in practice?
All objects of a class share the same structure and methods, but each holds its own data. Changing one customer's address does not affect any other customer.
What should you keep in mind with Object (Instance)?
In frameworks like Laravel, each database row usually becomes an object, such as an Eloquent model, with methods to work with its data. Objects are most useful when they protect their own rules. An Order object that refuses to be shipped before it is paid is safer than one where any code can set any property. Keeping behaviour together with the data it concerns is the core idea of object-oriented design.
Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel/PHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.