Skip to content

Commit

Permalink
Refactor: Seeder, views, and migrations for consistency (#28)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and fuelviews-app[bot] committed Feb 8, 2025
1 parent ea8d005 commit 44bb4b3
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 52 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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

## v0.0.15 - 2025-02-08

### What's Changed

* Refactor: Seeder, views, and migrations for consistency by @thejmitchener in https://github.com/fuelviews/laravel-sabhero-wrapper/pull/28

**Full Changelog**: https://github.com/fuelviews/laravel-sabhero-wrapper/commits/v0.0.15

## v0.0.14 - 2025-02-08

### What's Changed
Expand Down
25 changes: 25 additions & 0 deletions database/factories/PageFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace database\factories;

use Fuelviews\SabHeroWrapper\Models\Page;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;

class PageFactory extends Factory
{
protected $model = Page::class;

public function definition(): array
{
return [
'slug' => $this->faker->slug(),
'title' => $this->faker->word(),
'description' => $this->faker->text(),
'image' => $this->faker->word(),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'registerMediaConversionsUsingModelInstance' => $this->faker->boolean(),
];
}
}
6 changes: 1 addition & 5 deletions database/migrations/create_pages_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ public function up(): void
$table->string('slug', 80)->unique();
$table->string('title', 80)->unique();
$table->text('description');
$table->string('image', 80)->unique();
$table->string('feature_image', 80)->unique();

$table->timestamps();

$table->index('slug');
$table->index('title');
$table->index('image');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class PagesTableSeeder extends Seeder
class PageTableSeeder extends Seeder
{
/**
* Run the database seeds.
Expand Down
50 changes: 21 additions & 29 deletions resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">

@if (class_exists(RalphJSmit\Laravel\SEO\SEOManager::class))
@isset($page)
{!! seo()->for($page) !!}
@endisset
@isset($post)
{!! seo()->for($post) !!}
@endisset
@if(empty($page) && empty($post))
{!! seo() !!}
@endif
{!! seo($page ?? $seoPage ?? $seoPost ?? null) !!}
@endif

@vite(['resources/css/app.css', 'resources/js/app.js'])
Expand All @@ -35,29 +28,28 @@
@endif
</head>
<body>
@if (class_exists(\Fuelviews\Navigation\Navigation::class) && config('sabhero-wrapper.navigation_enabled'))
@component('navigation::components.navigation')
@endcomponent
@endif

{{ $slot }}
@if (class_exists(\Fuelviews\Navigation\Navigation::class) && config('sabhero-wrapper.navigation_enabled'))
@component('navigation::components.navigation')
@endcomponent
@endif

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

@if (class_exists(\Fuelviews\Forms\Forms::class) && config('sabhero-wrapper.forms_modal_enabled'))
@livewire('forms-modal')
@endif
@if (class_exists(\Fuelviews\Navigation\View\Components\Footer\Footer::class) && config('sabhero-wrapper.footer_enabled'))
@component('navigation::components.footer.footer')
@endcomponent
@endif

@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('sabhero-wrapper.gtm_enabled'))
@include('googletagmanager::body')
@endif
@if (class_exists(\Fuelviews\Forms\Forms::class) && config('sabhero-wrapper.forms_modal_enabled'))
@livewire('forms-modal')
@endif

@if (class_exists(\Livewire\Livewire::class) && config('sabhero-wrapper.livewire_enabled'))
@livewireScripts
@endif
@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('sabhero-wrapper.gtm_enabled'))
@include('googletagmanager::body')
@endif

@if (class_exists(\Livewire\Livewire::class) && config('sabhero-wrapper.livewire_enabled'))
@livewireScripts
@endif
</body>
</html>
Loading

0 comments on commit 44bb4b3

Please sign in to comment.