class Person { public $name; public $age; public function __construct($name, $age) { $this->name = $name; $this->age = $age; } } $person1 = new Person('John', 25); $person2 = new Person('Jane', 30);
use Illuminate\Database\Eloquent\Model; class User extends Model { protected $table = 'users'; protected $fillable = ['name', 'email', 'password']; } $user1 = new User(['name' => 'John', 'email' => 'john@example.com', 'password' => 'password123']); $user2 = new User(['name' => 'Jane', 'email' => 'jane@example.com', 'password' => 'password456']);In this example, we use the `Illuminate\Database\Eloquent\Model` package library to create a `User` class that extends the `Model` class. We define two properties - `$table` and `$fillable` - that are used by the `Model` class to interact with the users table in a database. We then create two instances of the `User` class - `$user1` and `$user2` - and initialize them with different values using an array as an argument to the constructor. Package library: `Illuminate\Database\Eloquent` from the Laravel framework.