Skip to content

Commit a680e53

Browse files
authored
Merge pull request #3436 from codeeu/dev
Dev
2 parents a553249 + dc2f0ce commit a680e53

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\DB;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration {
8+
private const OLD_DEFAULT = 'Explore Career Pathway';
9+
10+
private const NEW_DEFAULT = 'For inspiration from more role models check out <a class="text-dark-blue underline" target="_blank" rel="noopener" href="https://high5girls.dk/bliv-rollemodel-2/">High5Girls rollemodeller - kvinder i STEM-fag</a>';
11+
12+
public function up(): void
13+
{
14+
if (! Schema::hasTable('dream_job_role_models') || ! Schema::hasColumn('dream_job_role_models', 'pathway_title')) {
15+
return;
16+
}
17+
18+
DB::table('dream_job_role_models')
19+
->whereNull('pathway_title')
20+
->orWhere('pathway_title', '')
21+
->orWhere('pathway_title', self::OLD_DEFAULT)
22+
->update(['pathway_title' => self::NEW_DEFAULT]);
23+
}
24+
25+
public function down(): void
26+
{
27+
if (! Schema::hasTable('dream_job_role_models') || ! Schema::hasColumn('dream_job_role_models', 'pathway_title')) {
28+
return;
29+
}
30+
31+
DB::table('dream_job_role_models')
32+
->where('pathway_title', self::NEW_DEFAULT)
33+
->update(['pathway_title' => self::OLD_DEFAULT]);
34+
}
35+
};

database/seeders/DreamJobRoleModelSeeder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
class DreamJobRoleModelSeeder extends Seeder
99
{
10+
private const DEFAULT_PATHWAY_TITLE = 'For inspiration from more role models check out <a class="text-dark-blue underline" target="_blank" rel="noopener" href="https://high5girls.dk/bliv-rollemodel-2/">High5Girls rollemodeller - kvinder i STEM-fag</a>';
11+
1012
/**
1113
* Seed Dream Jobs role models from the current hardcoded defaults.
1214
* Safe to run multiple times (upserts by slug).
@@ -199,7 +201,7 @@ public function run(): void
199201
'link' => $row['link'],
200202
'video' => $row['video'],
201203
'pathway_map_link' => $row['pathway_map_link'] !== '' ? $row['pathway_map_link'] : null,
202-
'pathway_title' => $row['pathway_title'] ?? 'Explore Career Pathway',
204+
'pathway_title' => $row['pathway_title'] ?? self::DEFAULT_PATHWAY_TITLE,
203205
'pathway_cta_text' => $row['pathway_cta_text'] ?? 'Career Pathway Map',
204206
'position' => $index,
205207
'active' => true,

resources/views/static/dream-jobs-in-digital-role.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@
222222
abort_if(! $item, 404);
223223
}
224224
225-
$item['pathway_title'] = (string) ($item['pathway_title'] ?? 'Explore Career Pathway');
225+
$defaultPathwayTitle = 'For inspiration from more role models check out <a class="text-dark-blue underline" target="_blank" rel="noopener" href="https://high5girls.dk/bliv-rollemodel-2/">High5Girls rollemodeller - kvinder i STEM-fag</a>';
226+
$item['pathway_title'] = (string) ($item['pathway_title'] ?? $defaultPathwayTitle);
226227
$item['pathway_cta_text'] = (string) ($item['pathway_cta_text'] ?? 'Career Pathway Map');
227228
228229
$list = [

0 commit comments

Comments
 (0)