Let's take a look at a simple operation with the database today.
Before using this code you should initialise capsule as written in this post.
Let's say we want to retrieve all the active domains and then loop through them, we can simply use this code:
$result = Capsule::table('tbldomains')->where('status', 'Active')->get(); foreach ($result as $data) { $id = $data->id; }