wind-framework / eloquent
Wind framework eloquent.
1.0.0-beta.2
2024-02-27 08:45 UTC
Requires
- pader/amphp-eloquent-mysql: ^1.0@beta
- wind-framework/wind-framework: ^1.0
This package is auto-updated.
Last update: 2024-12-10 04:02:54 UTC
README
Async/Coroutine Laravel Database for Wind Framework.
Usage:
- Make sure you have right database config in
config/database.php
. - Add
\Wind\Eloquent\Component::class
toconfig/components.php
. - Now you can use async/coroutine, connection pool, high concurrency Eloquent.
Examples:
// use DB Facade use Illuminate\Support\Facades\DB $user = DB::table('users')->first(); print_r($user); // define a user model, and query by model class User extends \Illuminate\Database\Eloquent\Model { protected $table = 'users'; public function books() { return $this->hasMany(Books::class); } } $user = User::query()->with('books')->first(); print_r($user?->toArray());