magicai / app /Models /Integration /Integration.php
Softin Trading
Initial commit from Github
5f32fbd
Raw History Blame Contribute Delete
747 Bytes
<?php
namespace App\Models\Integration;
use App\Models\Extension;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
class Integration extends Model
{
protected $table = 'integrations';
protected $fillable = [
'app',
'description',
'image',
'slug',
'status',
];
public function hasExtension(): HasOne
{
return $this->hasOne(Extension::class, 'slug', 'slug')->where('installed', 1);
}
public function extension(): HasOne
{
return $this->hasOne(Extension::class, 'slug', 'slug');
}
public function getFormClassName(): string
{
return 'App\Services\Integration\\' . ucfirst($this->app);
}
}