require_once 'vendor/autoload.php'; use Illuminate\Database\Capsule\Manager as DB; //connect to the database $capsule = new DB; $capsule->addConnection([ "driver" => "mysql", "host" => "localhost", "database" => "mydatabase", "username" => "root", "password" => "" ]); //run query $records = DB::table('my_table')->get(); //loop through the records foreach($records as $record){ echo $record->id . " " . $record->name; }In this example, the findAll method is being used to retrieve all the records from a database table called "my_table". The database connection details are first established using the Illuminate\Database\Capsule\Manager library. The findAll() method is called on the table instance returned by the DB::table() method, which retrieves all records from the table. Finally, a foreach loop is used to iterate through the records and display the id and name value of each record. The package library used in this code example is the Laravel Eloquent ORM, which is a powerful and easy-to-use PHP library for working with databases.