Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

44
app/Models/Extension.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Extension extends Model
{
use HasFactory;
protected $fillable = [
'name',
'enabled',
// Name of extension class (e.g. 'Stripe' or 'Paypal')
'extension',
'type',
];
protected $guarded = [];
/**
* Get the extension's settings.
*/
public function settings()
{
return $this->morphMany(Setting::class, 'settingable');
}
public function path(): Attribute
{
return Attribute::make(
get: fn () => ucfirst($this->type) . 's/' . ucfirst($this->extension)
);
}
public function namespace(): Attribute
{
return Attribute::make(
get: fn () => 'Paymenter\\Extensions\\' . ucfirst($this->type) . 's\\' . ucfirst($this->extension)
);
}
}