Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Command.php
- This file was added.
<?php | |||||
namespace App\Console; | |||||
class Command extends \Illuminate\Console\Command | |||||
{ | |||||
/** | |||||
* Find the domain. | |||||
* | |||||
* @param string $domain Domain ID or namespace | |||||
* | |||||
* @return \App\Domain|null | |||||
*/ | |||||
public function getDomain($domain) | |||||
{ | |||||
if (is_numeric($domain)) { | |||||
return \App\Domain::find($domain); | |||||
} | |||||
return \App\Domain::where('namespace', \strtolower($domain))->first(); | |||||
} | |||||
/** | |||||
* Find the user. | |||||
* | |||||
* @param string $user User ID or email | |||||
* | |||||
* @return \App\User|null | |||||
*/ | |||||
public function getUser($user) | |||||
{ | |||||
if (is_numeric($user)) { | |||||
return \App\User::find($user); | |||||
} | |||||
return \App\User::where('email', \strtolower($user))->first(); | |||||
} | |||||
} |