Standalone library for database interaction
This project is maintained by Corviz
Corviz database layer provides a simple yet powerful interface to run your database operations.
We use Hydrahon query builder as it’s base components, extending it with a Model. It means that all operations included in their library will be avaliable for your models as well.
composer require corviz/database-layer
And more coming soon!
Example 1 - Fetch active users:
$users = User::query()->where('active', true)->get();
foreach ($users as $user) {
echo $user->id, ' - ', $user->email;
}
Example 2 - Create and save a contact:
$contact = new Contact();
$contact->name = 'John';
$contact->phone = '+1 (999) 999-9999';
$contact->insert();
Example 3 - Create messages in the messages table:
Message::create([
[
'message' => 'This is an warning message',
'level' => 'warning'
],
[
'message' => 'This is an info message',
'level' => 'info'
]
]);