initial import

This commit is contained in:
2025-07-30 09:47:03 +02:00
commit b0a186a324
292 changed files with 32323 additions and 0 deletions

22
app/Models/AiModel.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AiModel extends Model
{
use HasFactory;
protected $fillable = [
'name',
'model_id',
'model_type',
];
public function apiProviders()
{
return $this->belongsToMany(ApiProvider::class, 'ai_model_api_provider');
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ApiProvider extends Model
{
use HasFactory;
protected $fillable = [
'name',
'api_url',
'username',
'password',
'token',
'plugin',
'enabled',
];
protected $casts = [
'enabled' => 'boolean',
];
public function styles()
{
return $this->hasMany(Style::class);
}
public function aiModels()
{
return $this->belongsToMany(AiModel::class, 'ai_model_api_provider');
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class DummyPluginModel extends Model
{
protected $table = null; // No actual table
protected $guarded = []; // Allow mass assignment for all attributes
public $incrementing = false;
protected $keyType = 'string';
protected $primaryKey = 'id';
public function newCollection(array $models = [])
{
return new \Illuminate\Database\Eloquent\Collection($models);
}
public function newEloquentBuilder($query)
{
return new \App\Filament\Resources\PluginResource\CollectionEloquentBuilder($query);
}
}

17
app/Models/Image.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
class Image extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'path',
'uuid',
];
}

18
app/Models/Role.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Role extends Model
{
use HasFactory;
protected $fillable = ['name'];
public function users()
{
return $this->hasMany(User::class);
}
}

30
app/Models/Style.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Style extends Model
{
use HasFactory;
protected $fillable = [
'title',
'prompt',
'description',
'preview_image',
'parameters',
'ai_model_id',
'enabled',
];
protected $casts = [
'enabled' => 'boolean',
];
public function aiModel()
{
return $this->belongsTo(AiModel::class);
}
}

50
app/Models/User.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
'role_id',
];
public function role()
{
return $this->belongsTo(Role::class);
}
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}