belongsTo(Provider::class); } public function module() { return $this->belongsTo(Module::class); } public function getIsEnabledAttribute($value) { return (bool) $value; } protected static function boot() { parent::boot(); static::creating(function ($model) { // if local if (!app()->environment('local')) { $model->api_token = Str::random(60); } }); } }