diff --git a/web/Modules/Minecraft/App/Models/MinecraftServer.php b/web/Modules/Minecraft/App/Models/MinecraftServer.php index 332fa01..f5d0e50 100644 --- a/web/Modules/Minecraft/App/Models/MinecraftServer.php +++ b/web/Modules/Minecraft/App/Models/MinecraftServer.php @@ -2,6 +2,7 @@ namespace Modules\Minecraft\App\Models; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Modules\Minecraft\Database\factories\MinecraftServerFactory; @@ -16,4 +17,37 @@ class MinecraftServer extends Model protected $fillable = []; + protected static function booted(): void + { + static::addGlobalScope('customer', function (Builder $query) { + if (auth()->check() && auth()->guard()->name == 'web_customer') { + $query->where('customer_id', auth()->user()->id); + } + }); + } + + + public static function boot() + { + parent::boot(); + + static::creating(function ($model) { + + + }); + + static::created(function ($model) { + + + }); + + static::deleting(function ($model) { + + + + + }); + + } + } diff --git a/web/Modules/Minecraft/resources/views/actions/minecraft-docker-yaml.blade.php b/web/Modules/Minecraft/resources/views/actions/minecraft-docker-yaml.blade.php new file mode 100644 index 0000000..d8fc544 --- /dev/null +++ b/web/Modules/Minecraft/resources/views/actions/minecraft-docker-yaml.blade.php @@ -0,0 +1,9 @@ +services: + minecraft-server: + image: itzg/minecraft-server + tty: true + stdin_open: true + ports: + - "25565:25565" + environment: + EULA: "TRUE"