Skip to content

Commit 44bb4b3

Browse files
thejmitchenerdependabot[bot]
authored andcommitted
Refactor: Seeder, views, and migrations for consistency (#28)
* Refactor: Seeder, views, and migrations for consistency Replaced `PagesTableSeeder` with `PageTableSeeder` and updated related paths. Adjusted view components and layouts for streamlined coding practices and enhanced readability. Refactored migrations to update column naming and removed redundant indexing. * Fix styling * Bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 (#27) * Bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](dependabot/fetch-metadata@v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Fix styling --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix styling * Fix styling * Fix styling --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ea8d005 commit 44bb4b3

File tree

7 files changed

+73
-52
lines changed

7 files changed

+73
-52
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `laravel-sabhero-wrapper` will be documented in this file.
44

5+
## v0.0.15 - 2025-02-08
6+
7+
### What's Changed
8+
9+
* Refactor: Seeder, views, and migrations for consistency by @thejmitchener in https://github.com/fuelviews/laravel-sabhero-wrapper/pull/28
10+
11+
**Full Changelog**: https://github.com/fuelviews/laravel-sabhero-wrapper/commits/v0.0.15
12+
513
## v0.0.14 - 2025-02-08
614

715
### What's Changed

database/factories/PageFactory.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace database\factories;
4+
5+
use Fuelviews\SabHeroWrapper\Models\Page;
6+
use Illuminate\Database\Eloquent\Factories\Factory;
7+
use Illuminate\Support\Carbon;
8+
9+
class PageFactory extends Factory
10+
{
11+
protected $model = Page::class;
12+
13+
public function definition(): array
14+
{
15+
return [
16+
'slug' => $this->faker->slug(),
17+
'title' => $this->faker->word(),
18+
'description' => $this->faker->text(),
19+
'image' => $this->faker->word(),
20+
'created_at' => Carbon::now(),
21+
'updated_at' => Carbon::now(),
22+
'registerMediaConversionsUsingModelInstance' => $this->faker->boolean(),
23+
];
24+
}
25+
}

database/migrations/create_pages_table.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ public function up(): void
1818
$table->string('slug', 80)->unique();
1919
$table->string('title', 80)->unique();
2020
$table->text('description');
21-
$table->string('image', 80)->unique();
21+
$table->string('feature_image', 80)->unique();
2222

2323
$table->timestamps();
24-
25-
$table->index('slug');
26-
$table->index('title');
27-
$table->index('image');
2824
});
2925
}
3026

database/seeders/PagesTableSeeder.php database/seeders/PageTableSeeder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Illuminate\Support\Facades\DB;
77
use Illuminate\Support\Str;
88

9-
class PagesTableSeeder extends Seeder
9+
class PageTableSeeder extends Seeder
1010
{
1111
/**
1212
* Run the database seeds.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
<!doctype html>
2-
<html lang="{{ app()->getLocale() }}">
2+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="csrf-token" content="{{ csrf_token() }}">
67

78
@if (class_exists(RalphJSmit\Laravel\SEO\SEOManager::class))
8-
@isset($page)
9-
{!! seo()->for($page) !!}
10-
@endisset
11-
@isset($post)
12-
{!! seo()->for($post) !!}
13-
@endisset
14-
@if(empty($page) && empty($post))
15-
{!! seo() !!}
16-
@endif
9+
{!! seo($page ?? $seoPage ?? $seoPost ?? null) !!}
1710
@endif
1811

1912
@vite(['resources/css/app.css', 'resources/js/app.js'])
@@ -35,29 +28,28 @@
3528
@endif
3629
</head>
3730
<body>
38-
@if (class_exists(\Fuelviews\Navigation\Navigation::class) && config('sabhero-wrapper.navigation_enabled'))
39-
@component('navigation::components.navigation')
40-
@endcomponent
41-
@endif
42-
43-
{{ $slot }}
31+
@if (class_exists(\Fuelviews\Navigation\Navigation::class) && config('sabhero-wrapper.navigation_enabled'))
32+
@component('navigation::components.navigation')
33+
@endcomponent
34+
@endif
4435

45-
@if (class_exists(\Fuelviews\Navigation\View\Components\Footer\Footer::class) && config('sabhero-wrapper.footer_enabled'))
46-
@component('navigation::components.footer.footer')
47-
@endcomponent
48-
@endif
36+
{{ $slot }}
4937

50-
@if (class_exists(\Fuelviews\Forms\Forms::class) && config('sabhero-wrapper.forms_modal_enabled'))
51-
@livewire('forms-modal')
52-
@endif
38+
@if (class_exists(\Fuelviews\Navigation\View\Components\Footer\Footer::class) && config('sabhero-wrapper.footer_enabled'))
39+
@component('navigation::components.footer.footer')
40+
@endcomponent
41+
@endif
5342

54-
@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('sabhero-wrapper.gtm_enabled'))
55-
@include('googletagmanager::body')
56-
@endif
43+
@if (class_exists(\Fuelviews\Forms\Forms::class) && config('sabhero-wrapper.forms_modal_enabled'))
44+
@livewire('forms-modal')
45+
@endif
5746

58-
@if (class_exists(\Livewire\Livewire::class) && config('sabhero-wrapper.livewire_enabled'))
59-
@livewireScripts
60-
@endif
47+
@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('sabhero-wrapper.gtm_enabled'))
48+
@include('googletagmanager::body')
49+
@endif
6150

51+
@if (class_exists(\Livewire\Livewire::class) && config('sabhero-wrapper.livewire_enabled'))
52+
@livewireScripts
53+
@endif
6254
</body>
6355
</html>

0 commit comments

Comments
 (0)