-
app/Traits/Encryptable.php
Open in GitHubuse Illuminate\Support\Facades\Crypt; trait Encryptable { public function getAttribute($key) { $value = parent::getAttribute($key); if (\in_array($key, $this->encryptable, true)) { return Crypt::decrypt($value); } return $value; } public function setAttribute($key, $value) { if (\in_array($key, $this->encryptable, true)) { $value = Crypt::encrypt($value); } return parent::setAttribute($key, $value); } }
-
app/Models/Seedbox.php
Open in GitHubuse App\Traits\Encryptable; use Illuminate\Database\Eloquent\Model; class Seedbox extends Model { use Encryptable; // }