Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117916127
D2587.1775409311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D2587.1775409311.diff
View Options
diff --git a/src/app/Domain.php b/src/app/Domain.php
--- a/src/app/Domain.php
+++ b/src/app/Domain.php
@@ -443,7 +443,7 @@
public function wallet(): ?Wallet
{
// Note: Not all domains have a entitlement/wallet
- $entitlement = $this->entitlement()->withTrashed()->first();
+ $entitlement = $this->entitlement()->withTrashed()->orderBy('created_at', 'desc')->first();
return $entitlement ? $entitlement->wallet : null;
}
diff --git a/src/app/Group.php b/src/app/Group.php
--- a/src/app/Group.php
+++ b/src/app/Group.php
@@ -273,7 +273,7 @@
public function wallet(): ?Wallet
{
// Note: Not all domains have a entitlement/wallet
- $entitlement = $this->entitlement()->withTrashed()->first();
+ $entitlement = $this->entitlement()->withTrashed()->orderBy('created_at', 'desc')->first();
return $entitlement ? $entitlement->wallet : null;
}
diff --git a/src/app/OpenVidu/RoomSetting.php b/src/app/OpenVidu/RoomSetting.php
--- a/src/app/OpenVidu/RoomSetting.php
+++ b/src/app/OpenVidu/RoomSetting.php
@@ -21,16 +21,12 @@
protected $table = 'openvidu_room_settings';
/**
- * The user to which this setting belongs.
+ * The room to which this setting belongs.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function room()
{
- return $this->belongsTo(
- '\App\OpenVidu\Room',
- 'room_id', /* local */
- 'id' /* remote */
- );
+ return $this->belongsTo('\App\OpenVidu\Room', 'room_id', 'id');
}
}
diff --git a/src/app/Payment.php b/src/app/Payment.php
--- a/src/app/Payment.php
+++ b/src/app/Payment.php
@@ -52,10 +52,6 @@
*/
public function wallet()
{
- return $this->belongsTo(
- '\App\Wallet',
- 'wallet_id', /* local */
- 'id' /* remote */
- );
+ return $this->belongsTo('\App\Wallet', 'wallet_id', 'id');
}
}
diff --git a/src/app/User.php b/src/app/User.php
--- a/src/app/User.php
+++ b/src/app/User.php
@@ -634,7 +634,7 @@
*/
public function wallet(): ?Wallet
{
- $entitlement = $this->entitlement()->withTrashed()->first();
+ $entitlement = $this->entitlement()->withTrashed()->orderBy('created_at', 'desc')->first();
// TODO: No entitlement should not happen, but in tests we have
// such cases, so we fallback to the user's wallet in this case
diff --git a/src/app/UserAlias.php b/src/app/UserAlias.php
--- a/src/app/UserAlias.php
+++ b/src/app/UserAlias.php
@@ -24,10 +24,6 @@
*/
public function user()
{
- return $this->belongsTo(
- '\App\User',
- 'user_id', /* local */
- 'id' /* remote */
- );
+ return $this->belongsTo('\App\User', 'user_id', 'id');
}
}
diff --git a/src/app/UserSetting.php b/src/app/UserSetting.php
--- a/src/app/UserSetting.php
+++ b/src/app/UserSetting.php
@@ -25,10 +25,6 @@
*/
public function user()
{
- return $this->belongsTo(
- '\App\User',
- 'user_id', /* local */
- 'id' /* remote */
- );
+ return $this->belongsTo('\App\User', 'user_id', 'id');
}
}
diff --git a/src/app/WalletSetting.php b/src/app/WalletSetting.php
--- a/src/app/WalletSetting.php
+++ b/src/app/WalletSetting.php
@@ -25,10 +25,6 @@
*/
public function wallet()
{
- return $this->belongsTo(
- '\App\Wallet',
- 'wallet_id', /* local */
- 'id' /* remote */
- );
+ return $this->belongsTo('\App\Wallet', 'wallet_id', 'id');
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 5:15 PM (1 d, 11 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18804273
Default Alt Text
D2587.1775409311.diff (3 KB)
Attached To
Mode
D2587: Improve wallet() methods accuracy
Attached
Detach File
Event Timeline