Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

HDInnovations/UNIT3D-Community-Edition

2239 stars
2 code files
View HDInnovations/UNIT3D-Community-Edition on GitHub

app/Traits/Encryptable.php

Open in GitHub
use 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 GitHub
use App\Traits\Encryptable;
use Illuminate\Database\Eloquent\Model;
 
class Seedbox extends Model
{
use Encryptable;
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.