Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Add gitWebhook method to Application model and fix Dockerfile input display

Andras Bacsai3a3c9448a4e1
diff --git a/app/Models/Application.php b/app/Models/Application.php
index 0e72f94ce8..27f34df341 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -85,6 +85,18 @@ class Application extends BaseModel
);
}
+ public function gitWebhook(): Attribute
+ {
+ return Attribute::make(
+ get: function () {
+ if (!is_null($this->source?->html_url) && !is_null($this->git_repository) && !is_null($this->git_branch)) {
+ return "{$this->source->html_url}/{$this->git_repository}/settings/hooks";
+ }
+ return $this->git_repository;
+ }
+ );
+ }
+
public function gitCommits(): Attribute
{
return Attribute::make(
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 173aa52e89..2753b4bf75 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -69,10 +69,12 @@
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input placeholder="/" id="application.base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." />
- @if ($application->build_pack === 'dockerfile')
+ @if ($application->build_pack === 'dockerfile' && !$application->dockerfile)
<x-forms.input placeholder="/Dockerfile" id="application.dockerfile_location"
label="Dockerfile Location"
helper="It is calculated together with the Base Directory: {{ Str::start($application->base_directory . $application->dockerfile_location, '/') }}" />
+ @endif
+ @if ($application->build_pack === 'dockerfile')
<x-forms.input id="application.dockerfile_target_build" label="Docker Build Stage Target"
helper="Useful if you have multi-staged dockerfile." />
@endif