breakign changes

This commit is contained in:
Mark Gregory
2026-07-24 15:16:10 +01:00
parent 157450cf44
commit 4988cb85bd
15 changed files with 457 additions and 76 deletions
@@ -1 +1,27 @@
<x-layouts.app :title="__('Blog')"><div class="mx-auto max-w-5xl"><h1 class="mb-8 text-4xl font-bold">Blog</h1><div class="grid gap-6 md:grid-cols-2">@foreach($records as $record)<article class="rounded-xl border p-6"><h2 class="text-xl font-semibold"><a href="{{ route('blog.public.show',$record->slug) }}">{{ $record->title }}</a></h2><p class="mt-2 text-zinc-600">{{ $record->excerpt }}</p></article>@endforeach</div><div class="mt-8">{{ $records->links() }}</div></div></x-layouts.app>
<x-stylist-theme-saasland::layouts.app
title="Blog"
description="Ideas, guides and updates from our team."
eyebrow="Insights"
:breadcrumbs="['Blog' => null]"
>
<section class="content-section">
<div class="wrap">
<div class="content-grid">
@forelse($records as $record)
<article class="post-card">
<div class="post-card-accent"></div>
<div class="post-card-body">
<span class="post-meta">{{ optional($record->published_at)->format('j F Y') ?: 'Latest article' }}</span>
<h2><a href="{{ route('blog.public.show', $record->slug) }}">{{ $record->title }}</a></h2>
@if($record->excerpt)<p>{{ $record->excerpt }}</p>@endif
<a class="read-more" href="{{ route('blog.public.show', $record->slug) }}">Read article →</a>
</div>
</article>
@empty
<div class="empty-state">No blog posts have been published yet.</div>
@endforelse
</div>
<div class="theme-pagination">{{ $records->links() }}</div>
</div>
</section>
</x-stylist-theme-saasland::layouts.app>
@@ -1 +1,19 @@
<x-layouts.app :title="$record->title"><article class="mx-auto max-w-3xl"><h1 class="text-4xl font-bold">{{ $record->title }}</h1><p class="mt-3 text-zinc-500">{{ optional($record->published_at)->format('j F Y') }}</p><div class="prose mt-8 max-w-none">{!! nl2br(e($record->content)) !!}</div></article></x-layouts.app>
<x-stylist-theme-saasland::layouts.app
:title="$record->title"
:description="$record->excerpt"
eyebrow="Blog"
:breadcrumbs="['Blog' => route('blog.public.index'), $record->title => null]"
>
<section class="content-section">
<div class="wrap content-layout">
<article class="content-card prose-content">
<div class="article-meta">
@if($record->author)<span>{{ $record->author->name }}</span>@endif
@if($record->published_at)<time datetime="{{ $record->published_at->toDateString() }}">{{ $record->published_at->format('j F Y') }}</time>@endif
</div>
@if($record->excerpt)<p class="content-lead">{{ $record->excerpt }}</p>@endif
<div class="cms-content">{!! nl2br(e($record->content)) !!}</div>
</article>
</div>
</section>
</x-stylist-theme-saasland::layouts.app>
@@ -1 +1,27 @@
<x-layouts.app :title="__('News')"><div class="mx-auto max-w-5xl"><h1 class="mb-8 text-4xl font-bold">News</h1><div class="grid gap-6 md:grid-cols-2">@foreach($records as $record)<article class="rounded-xl border p-6"><h2 class="text-xl font-semibold"><a href="{{ route('news.public.show',$record->slug) }}">{{ $record->title }}</a></h2><p class="mt-2 text-zinc-600">{{ $record->excerpt }}</p></article>@endforeach</div><div class="mt-8">{{ $records->links() }}</div></div></x-layouts.app>
<x-stylist-theme-saasland::layouts.app
title="News"
description="The latest announcements, releases and company updates."
eyebrow="Updates"
:breadcrumbs="['News' => null]"
>
<section class="content-section">
<div class="wrap">
<div class="content-grid">
@forelse($records as $record)
<article class="post-card">
<div class="post-card-accent"></div>
<div class="post-card-body">
<span class="post-meta">{{ optional($record->published_at)->format('j F Y') ?: 'Latest update' }}</span>
<h2><a href="{{ route('news.public.show', $record->slug) }}">{{ $record->title }}</a></h2>
@if($record->excerpt)<p>{{ $record->excerpt }}</p>@endif
<a class="read-more" href="{{ route('news.public.show', $record->slug) }}">Read update →</a>
</div>
</article>
@empty
<div class="empty-state">No news has been published yet.</div>
@endforelse
</div>
<div class="theme-pagination">{{ $records->links() }}</div>
</div>
</section>
</x-stylist-theme-saasland::layouts.app>
@@ -1 +1,19 @@
<x-layouts.app :title="$record->title"><article class="mx-auto max-w-3xl"><h1 class="text-4xl font-bold">{{ $record->title }}</h1><p class="mt-3 text-zinc-500">{{ optional($record->published_at)->format('j F Y') }}</p><div class="prose mt-8 max-w-none">{!! nl2br(e($record->content)) !!}</div></article></x-layouts.app>
<x-stylist-theme-saasland::layouts.app
:title="$record->title"
:description="$record->excerpt"
eyebrow="News"
:breadcrumbs="['News' => route('news.public.index'), $record->title => null]"
>
<section class="content-section">
<div class="wrap content-layout">
<article class="content-card prose-content">
<div class="article-meta">
@if($record->author)<span>{{ $record->author->name }}</span>@endif
@if($record->published_at)<time datetime="{{ $record->published_at->toDateString() }}">{{ $record->published_at->format('j F Y') }}</time>@endif
</div>
@if($record->excerpt)<p class="content-lead">{{ $record->excerpt }}</p>@endif
<div class="cms-content">{!! nl2br(e($record->content)) !!}</div>
</article>
</div>
</section>
</x-stylist-theme-saasland::layouts.app>
@@ -1 +1,18 @@
<x-layouts.app :title="$page->title"><article class="prose mx-auto max-w-4xl py-10 dark:prose-invert"><h1>{{ $page->title }}</h1>@if($page->summary)<p class="lead">{{ $page->summary }}</p>@endif{!! $page->content !!}</article></x-layouts.app>
<x-stylist-theme-saasland::layouts.app
:title="$page->title"
:description="$page->summary"
eyebrow="Page"
:breadcrumbs="[$page->title => null]"
>
<section class="content-section">
<div class="wrap content-layout">
<article class="content-card prose-content">
@if ($page->summary)
<p class="content-lead">{{ $page->summary }}</p>
@endif
<div class="cms-content">{!! $page->content !!}</div>
</article>
</div>
</section>
</x-stylist-theme-saasland::layouts.app>
@@ -13,7 +13,10 @@ use Modules\Stylist\Console\ThemeDoctorCommand;
use Modules\Stylist\Console\ValidateThemeCommand;
use Modules\Stylist\Html\ThemeHtmlBuilder;
use Modules\Stylist\Html\ThemeSeoBuilder;
use Modules\Stylist\Support\FrontendNavigation;
use Modules\Stylist\Support\ModuleInfo;
use Modules\Stylist\Services\ThemeSettings;
use Modules\Stylist\Theme\Loader;
use Modules\Stylist\Theme\Stylist;
final class StylistServiceProvider extends ServiceProvider
@@ -62,6 +65,24 @@ final class StylistServiceProvider extends ServiceProvider
$view->with('activeTheme', $this->app->make(Stylist::class)->current());
});
View::composer('stylist-theme-saasland::*', function ($view): void {
$theme = $this->app->make(Loader::class)->find('saasland');
$settings = $this->app->make(ThemeSettings::class)->get($theme);
$navigation = $this->app->make(FrontendNavigation::class);
$view->with([
'siteTitle' => filled($settings['site_title'] ?? null) ? $settings['site_title'] : config('app.name', 'Saasland'),
'siteDescription' => filled($settings['site_description'] ?? null) ? $settings['site_description'] : 'Modern software for modern companies.',
'logoUrl' => $settings['logo_url'] ?? null,
'facebookUrl' => $settings['facebook_url'] ?? null,
'xUrl' => $settings['x_url'] ?? null,
'linkedinUrl' => $settings['linkedin_url'] ?? null,
'primaryNavigation' => $navigation->primary(),
'footerNavigation' => $navigation->footer(),
]);
});
}
private function registerViews(): void
@@ -0,0 +1,121 @@
<?php
namespace Modules\Stylist\Support;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Schema;
use Modules\Menus\Models\Menu;
use Throwable;
final class FrontendNavigation
{
/** @return array<int, array<string, mixed>> */
public function primary(): array
{
return $this->forLocations(['primary', 'header', 'main'], $this->fallbackPrimary());
}
/** @return array<int, array<string, mixed>> */
public function footer(): array
{
return $this->forLocations(['footer'], $this->fallbackFooter());
}
/** @param array<int, string> $locations
* @param array<int, array<string, mixed>> $fallback
* @return array<int, array<string, mixed>>
*/
private function forLocations(array $locations, array $fallback): array
{
try {
if (! Schema::hasTable('menus')) {
return $fallback;
}
$menu = Menu::query()
->where('enabled', true)
->whereIn('location', $locations)
->orderByRaw('CASE location '.collect($locations)->map(fn (string $location, int $index) => "WHEN ? THEN {$index}")->implode(' ').' ELSE 999 END', $locations)
->first();
if (! $menu || ! is_array($menu->items) || $menu->items === []) {
return $fallback;
}
$items = $this->normaliseItems($menu->items);
return $items === [] ? $fallback : $items;
} catch (Throwable) {
return $fallback;
}
}
/** @param array<int, mixed> $items
* @return array<int, array<string, mixed>>
*/
private function normaliseItems(array $items): array
{
return collect($items)
->filter(fn (mixed $item): bool => is_array($item) && ($item['enabled'] ?? true) !== false)
->map(function (array $item): ?array {
$label = trim((string) ($item['label'] ?? $item['title'] ?? $item['name'] ?? ''));
if ($label === '') {
return null;
}
$url = $this->resolveUrl($item);
if ($url === null) {
return null;
}
return [
'label' => $label,
'url' => $url,
'target' => ($item['target'] ?? null) === '_blank' ? '_blank' : null,
'children' => $this->normaliseItems((array) ($item['children'] ?? $item['items'] ?? [])),
];
})
->filter()
->values()
->all();
}
/** @param array<string, mixed> $item */
private function resolveUrl(array $item): ?string
{
$routeName = trim((string) ($item['route'] ?? $item['route_name'] ?? ''));
if ($routeName !== '' && Route::has($routeName)) {
return route($routeName, (array) ($item['parameters'] ?? []));
}
$pageSlug = trim((string) ($item['page_slug'] ?? $item['slug'] ?? ''));
if ($pageSlug !== '' && Route::has('pages.public.show')) {
return route('pages.public.show', $pageSlug);
}
$url = trim((string) ($item['url'] ?? $item['href'] ?? ''));
return $url !== '' ? $url : null;
}
/** @return array<int, array<string, mixed>> */
private function fallbackPrimary(): array
{
$items = [['label' => 'Home', 'url' => url('/'), 'target' => null, 'children' => []]];
if (Route::has('blog.public.index')) {
$items[] = ['label' => 'Blog', 'url' => route('blog.public.index'), 'target' => null, 'children' => []];
}
if (Route::has('news.public.index')) {
$items[] = ['label' => 'News', 'url' => route('news.public.index'), 'target' => null, 'children' => []];
}
return $items;
}
/** @return array<int, array<string, mixed>> */
private function fallbackFooter(): array
{
return $this->fallbackPrimary();
}
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -16,7 +16,7 @@
"animations": true,
"privacy": true,
"terms": true,
"auth": false,
"auth": true,
"preview": true,
"variants": true,
"settings": true,
+13 -69
View File
@@ -1,41 +1,8 @@
@push('theme-head')
<meta name="description" content="Transform your business with a modern SaaS platform.">
@endpush
<div class="saasland-theme" x-data="{ menuOpen: false, openFaq: null }">
<header class="nav">
<a href="/" class="logo">Saasland</a>
<nav aria-label="Primary navigation">
<a href="#features">Features</a>
<a href="#roadmap">Roadmap</a>
<a href="#pricing">Pricing</a>
<a href="#privacy">Privacy</a>
<a href="#terms">Terms</a>
<a href="#contact">Contact</a>
</nav>
<button
class="menu"
type="button"
aria-label="Toggle navigation"
:aria-expanded="menuOpen"
@click="menuOpen = ! menuOpen"
>
☰
</button>
</header>
<div class="mobile-nav" x-show="menuOpen" x-cloak>
<a href="#features" @click="menuOpen = false">Features</a>
<a href="#roadmap" @click="menuOpen = false">Roadmap</a>
<a href="#pricing" @click="menuOpen = false">Pricing</a>
<a href="#privacy" @click="menuOpen = false">Privacy</a>
<a href="#terms" @click="menuOpen = false">Terms</a>
<a href="#contact" @click="menuOpen = false">Contact</a>
</div>
<main>
<x-stylist-theme-saasland::layouts.app
:title="$siteTitle"
:description="$siteDescription"
:hero="true"
>
<section class="hero">
<div class="glow one"></div>
<div class="glow two"></div>
@@ -409,36 +376,13 @@
<div class="wrap">
<h2>Ready to transform your business?</h2>
<p>Start building a faster, more connected operation today.</p>
<a class="btn light" href="/register">Get started free →</a>
@auth
<a class="btn light" href="{{ route('dashboard') }}">Open dashboard →</a>
@else
@if (Route::has('register'))
<a class="btn light" href="{{ route('register') }}">Get started free →</a>
@endif
@endauth
</div>
</section>
</main>
<footer class="footer">
<div class="wrap footer-grid">
<div>
<a class="logo" href="/">Saasland</a>
<p>Modern software for modern companies.</p>
</div>
<div>
<b>Product</b>
<a href="#features">Features</a>
<a href="#pricing">Pricing</a>
</div>
<div>
<b>Company</b>
<a href="#contact">Contact</a>
<a href="#">About</a>
</div>
<div>
<b>Legal</b>
<a href="#privacy">Privacy</a>
<a href="#terms">Terms</a>
</div>
</div>
<div class="wrap copyright">
© {{ date('Y') }} Saasland. All rights reserved.
</div>
</footer>
</div>
</x-stylist-theme-saasland::layouts.app>
@@ -0,0 +1,62 @@
@props([
'title' => null,
'description' => null,
'eyebrow' => null,
'hero' => false,
'breadcrumbs' => [],
])
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" id="top">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ $title && $title !== $siteTitle ? $title.' — '.$siteTitle : $siteTitle }}</title>
<meta name="description" content="{{ $description ?: $siteDescription }}">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="stylesheet" href="{{ route('stylist.theme.asset', ['theme' => 'saasland', 'path' => 'css/theme.css']) }}">
@vite(['resources/css/app.css', 'resources/js/app.js'])
@stack('theme-head')
</head>
<body>
<div class="saasland-theme" x-data="{ menuOpen: false, openFaq: null }">
@include('stylist-theme-saasland::partials.header')
@unless($hero)
<section class="page-hero">
<div class="page-orb page-orb-one"></div>
<div class="page-orb page-orb-two"></div>
<div class="wrap page-hero-inner">
@if ($breadcrumbs)
<nav class="breadcrumbs" aria-label="Breadcrumb">
<a href="{{ url('/') }}">Home</a>
@foreach ($breadcrumbs as $label => $url)
<span aria-hidden="true">/</span>
@if ($url)<a href="{{ $url }}">{{ $label }}</a>@else<span aria-current="page">{{ $label }}</span>@endif
@endforeach
</nav>
@endif
@if ($eyebrow)<span class="eyebrow">{{ $eyebrow }}</span>@endif
<h1>{{ $title }}</h1>
@if ($description)<p>{{ $description }}</p>@endif
</div>
</section>
@endunless
<main class="{{ $hero ? 'marketing-main' : 'page-main' }}">
{{ $slot }}
</main>
@include('stylist-theme-saasland::partials.footer')
</div>
<script src="{{ route('stylist.theme.asset', ['theme' => 'saasland', 'path' => 'js/app.js']) }}" defer></script>
@stack('theme-scripts')
</body>
</html>
@@ -0,0 +1,36 @@
<footer class="footer">
<div class="wrap footer-grid">
<div class="footer-brand">
<a class="logo" href="{{ url('/') }}">{{ $siteTitle }}</a>
<p>{{ $siteDescription }}</p>
</div>
<div>
<b>Explore</b>
@foreach ($footerNavigation as $item)
<a href="{{ $item['url'] }}">{{ $item['label'] }}</a>
@endforeach
</div>
<div>
<b>Account</b>
@auth
<a href="{{ route('dashboard') }}">Dashboard</a>
@if (Route::has('profile.edit'))<a href="{{ route('profile.edit') }}">Profile</a>@endif
@else
@if (Route::has('login'))<a href="{{ route('login') }}">Log in</a>@endif
@if (Route::has('register'))<a href="{{ route('register') }}">Register</a>@endif
@endauth
</div>
<div>
<b>Connect</b>
@if ($facebookUrl)<a href="{{ $facebookUrl }}" target="_blank" rel="noopener">Facebook</a>@endif
@if ($xUrl)<a href="{{ $xUrl }}" target="_blank" rel="noopener">X</a>@endif
@if ($linkedinUrl)<a href="{{ $linkedinUrl }}" target="_blank" rel="noopener">LinkedIn</a>@endif
@unless($facebookUrl || $xUrl || $linkedinUrl)<a href="mailto:{{ config('mail.from.address') }}">Contact</a>@endunless
</div>
</div>
<div class="wrap copyright">
<span>© {{ date('Y') }} {{ $siteTitle }}. All rights reserved.</span>
<a href="#top">Back to top ↑</a>
</div>
</footer>
@@ -0,0 +1,68 @@
<header class="nav">
<a href="{{ url('/') }}" class="logo" aria-label="{{ $siteTitle }} home">
@if ($logoUrl)
<img src="{{ $logoUrl }}" alt="{{ $siteTitle }}">
@else
{{ $siteTitle }}
@endif
</a>
<nav class="desktop-nav" aria-label="Primary navigation">
@include('stylist-theme-saasland::partials.navigation-items', ['items' => $primaryNavigation])
</nav>
<div class="nav-actions">
@auth
<a class="nav-account" href="{{ route('dashboard') }}">Dashboard</a>
<div class="account-menu" x-data="{ accountOpen: false }">
<button type="button" class="account-trigger" @click="accountOpen = ! accountOpen" :aria-expanded="accountOpen">
<span>{{ str(auth()->user()->name)->substr(0, 1)->upper() }}</span>
<span class="account-name">{{ auth()->user()->name }}</span>
</button>
<div class="account-dropdown" x-show="accountOpen" @click.outside="accountOpen = false" x-cloak>
@if (Route::has('profile.edit'))
<a href="{{ route('profile.edit') }}">Profile</a>
@endif
@if (Route::has('settings.profile'))
<a href="{{ route('settings.profile') }}">Account settings</a>
@endif
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit">Log out</button>
</form>
</div>
</div>
@else
@if (Route::has('login'))
<a class="nav-login" href="{{ route('login') }}">Log in</a>
@endif
@if (Route::has('register'))
<a class="btn primary nav-register" href="{{ route('register') }}">Get started</a>
@endif
@endauth
<button class="menu" type="button" aria-label="Toggle navigation" :aria-expanded="menuOpen" @click="menuOpen = ! menuOpen">
<span></span><span></span><span></span>
</button>
</div>
</header>
<div class="mobile-nav" x-show="menuOpen" x-cloak>
@include('stylist-theme-saasland::partials.navigation-items', ['items' => $primaryNavigation])
<div class="mobile-auth">
@auth
<a href="{{ route('dashboard') }}">Dashboard</a>
@if (Route::has('profile.edit'))
<a href="{{ route('profile.edit') }}">Profile</a>
@endif
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit">Log out</button>
</form>
@else
@if (Route::has('login'))<a href="{{ route('login') }}">Log in</a>@endif
@if (Route::has('register'))<a class="mobile-primary" href="{{ route('register') }}">Get started</a>@endif
@endauth
</div>
</div>
@@ -0,0 +1,20 @@
@foreach ($items as $item)
@if (!empty($item['children']))
<div class="nav-dropdown" x-data="{ open: false }" @mouseenter="open = true" @mouseleave="open = false">
<button type="button" class="nav-dropdown-toggle" @click="open = ! open" :aria-expanded="open">
{{ $item['label'] }} <span aria-hidden="true">⌄</span>
</button>
<div class="nav-dropdown-menu" x-show="open" x-cloak>
@foreach ($item['children'] as $child)
<a href="{{ $child['url'] }}" @if($child['target']) target="{{ $child['target'] }}" rel="noopener" @endif>
{{ $child['label'] }}
</a>
@endforeach
</div>
</div>
@else
<a href="{{ $item['url'] }}" @if($item['target']) target="{{ $item['target'] }}" rel="noopener" @endif>
{{ $item['label'] }}
</a>
@endif
@endforeach
+1 -1
View File
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Route;
use Modules\Administration\Http\Controllers\DashboardController;
Route::get('/', function () {
return view('stylist-theme-welcome::welcome');
return stylist_theme_view('saasland', 'home');
})->name('home');
Route::middleware(['auth', 'verified'])->group(function () {