soft delete in a user model relations

This commit is contained in:
saparatayev 2022-02-28 17:19:31 +05:00
parent 190a575993
commit 674f7849cb
1 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class User extends UserBase
*/
public $belongsToMany = [
'groups' => [UserGroup::class, 'table' => 'users_groups'],
'chatrooms' => ['TPS\Birzha\Models\Chatroom', 'table'=>'tps_birzha_chatrooms_users']
'chatrooms' => ['TPS\Birzha\Models\Chatroom', 'table'=>'tps_birzha_chatrooms_users', 'delete' => true, 'softDelete' => true]
];
public $attachOne = [
@ -54,9 +54,9 @@ class User extends UserBase
];
public $hasMany = [
'products' => ['TPS\Birzha\Models\Product', 'key' => 'vendor_id'],
'transactions' => ['TPS\Birzha\Models\Transaction'],
'exchangerequests' => ['TPS\Birzha\Models\Exchangerequest'],
'products' => ['TPS\Birzha\Models\Product', 'key' => 'vendor_id', 'softDelete' => true],
'transactions' => ['TPS\Birzha\Models\Transaction', 'softDelete' => true],
'exchangerequests' => ['TPS\Birzha\Models\Exchangerequest', 'softDelete' => true],
];