Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use App\Wallet; | |||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
use Illuminate\Database\Eloquent\SoftDeletes; | use Illuminate\Database\Eloquent\SoftDeletes; | ||||
/** | /** | ||||
* The eloquent definition of a Domain. | * The eloquent definition of a Domain. | ||||
* | * | ||||
* @property string $namespace | * @property string $namespace | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 318 Lines • ▼ Show 20 Lines | public function verify(): bool | ||||
$this->status |= Domain::STATUS_VERIFIED; | $this->status |= Domain::STATUS_VERIFIED; | ||||
$this->save(); | $this->save(); | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/** | |||||
* Returns the wallet by which the domain is controlled | |||||
* | |||||
* @return \App\Wallet A wallet object | |||||
*/ | |||||
public function wallet(): Wallet | |||||
{ | |||||
return $this->entitlement()->first()->wallet; | |||||
} | |||||
} | } |