| laravel-code | SQL- QUERIES |
|---|---|
One-to-One hasOne(UserWallet::class) $user->wallet() |
select * from user_wallets where user_wallets.user_id = ? and user_wallets.user_id is not null |
One-to-Many hasMany(Notification::class) $user->notifications() |
select * from notifications where notifications.user_id = ? and notifications.user_id is not null |