Merge branch 'trunk'
This commit is contained in:
commit
a0d3c95305
3 changed files with 36 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -23,6 +23,9 @@ Homestead.yaml
|
|||
npm-debug.log
|
||||
yarn-error.log
|
||||
.npmrc
|
||||
.zshrc
|
||||
.npm/
|
||||
.composer/
|
||||
|
||||
# Ignore public favicon
|
||||
/public/android-chrome-192x192.png
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Lib\Helpers\ToolboxHelper;
|
||||
use App\Traits\Models\ActivityLog;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
|
@ -17,6 +18,9 @@ use Illuminate\Support\Str;
|
|||
* @property string $title Title for the page.
|
||||
* @property string $slug Slug of the title for the page.
|
||||
* @property string $content WYSIWYG text content using ckeditor.
|
||||
* @property string $picture Slide picture path.
|
||||
* @property string $picture_alt Slide picture alt attribute.
|
||||
* @property string $picture_title Slide picture title attribute.
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
||||
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
|
||||
*
|
||||
|
|
@ -37,6 +41,9 @@ class StaticPage extends Model
|
|||
'seo_description',
|
||||
'title',
|
||||
'content',
|
||||
'picture',
|
||||
'picture_alt',
|
||||
'picture_title',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -61,6 +68,9 @@ class StaticPage extends Model
|
|||
static::updating(function (self $model) {
|
||||
self::manageFields($model);
|
||||
});
|
||||
static::updated(function (self $model) {
|
||||
FileStorageHelper::removeOldFile($model, 'picture');
|
||||
});
|
||||
}
|
||||
|
||||
// * ROUTABLE
|
||||
|
|
@ -105,7 +115,9 @@ class StaticPage extends Model
|
|||
ToolboxHelper::assertNoInternalBoUrls('content', $model->content);
|
||||
$model->content = clean($model->content);
|
||||
}
|
||||
|
||||
if ($model->picture) {
|
||||
$model->picture = FileStorageHelper::storeFile($model, $model->picture, true);
|
||||
}
|
||||
// * TRANSFORMATIONS
|
||||
self::setSlug($model, $model->title);
|
||||
}
|
||||
|
|
|
|||
20
staging-resources.yaml
Normal file
20
staging-resources.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: ${CI_PROJECT_PATH_SLUG}-ingress-route
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`${APP_DOMAIN}`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: ${CI_PROJECT_PATH_SLUG}-service
|
||||
port: 80
|
||||
middlewares:
|
||||
- name: admin-ldc-whitelist
|
||||
namespace: common-services
|
||||
tls:
|
||||
secretName: ${CRT_TLS_NAME}
|
||||
Loading…
Add table
Reference in a new issue