Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117781474
D4743.1775248544.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D4743.1775248544.diff
View Options
diff --git a/src/app/Console/Commands/CompanionApp/DeleteCommand.php b/src/app/Console/Commands/CompanionApp/DeleteCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/CompanionApp/DeleteCommand.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Console\Commands\CompanionApp;
+
+use App\Console\ObjectDeleteCommand;
+
+class DeleteCommand extends ObjectDeleteCommand
+{
+ protected $dangerous = false;
+ protected $hidden = false;
+
+ protected $objectClass = \App\CompanionApp::class;
+ protected $objectName = 'companion-app';
+ protected $objectTitle = null;
+}
diff --git a/src/app/Console/Commands/CompanionApp/ListCommand.php b/src/app/Console/Commands/CompanionApp/ListCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/CompanionApp/ListCommand.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Console\Commands\CompanionApp;
+
+use App\Console\ObjectListCommand;
+
+class ListCommand extends ObjectListCommand
+{
+ protected $objectClass = \App\CompanionApp::class;
+ protected $objectName = 'companion-app';
+ protected $objectTitle = null;
+}
diff --git a/src/app/Console/Commands/User/CompanionAppsCommand.php b/src/app/Console/Commands/User/CompanionAppsCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/User/CompanionAppsCommand.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Console\Commands\User;
+
+use App\Console\ObjectRelationListCommand;
+
+class CompanionAppsCommand extends ObjectRelationListCommand
+{
+ protected $objectClass = \App\User::class;
+ protected $objectName = 'user';
+ protected $objectTitle = 'email';
+ protected $objectRelation = 'companionApps';
+}
diff --git a/src/app/User.php b/src/app/User.php
--- a/src/app/User.php
+++ b/src/app/User.php
@@ -506,6 +506,16 @@
return $this->entitleables(SharedFolder::class, $with_accounts);
}
+ /**
+ * Return companion apps by the current user.
+ *
+ * @return \Illuminate\Database\Eloquent\Builder Query builder
+ */
+ public function companionApps()
+ {
+ return \App\CompanionApp::where('user_id', $this->id);
+ }
+
public function senderPolicyFrameworkWhitelist($clientName)
{
$setting = $this->getSetting('spf_whitelist');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 8:35 PM (3 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826373
Default Alt Text
D4743.1775248544.diff (2 KB)
Attached To
Mode
D4743: CompanionApp commands
Attached
Detach File
Event Timeline