Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for logo and small impro #81

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/Http/Controllers/Website/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
use App\Actions\CMS\Page\PageQueryAction;
use App\Http\Controllers\Controller;
use App\Http\Resources\Web\CMS\FullPageResource;
use App\Models\Settings\ThemeSettings;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
use Spatie\LaravelSettings\Settings;

class PageController extends Controller
{
Expand Down Expand Up @@ -39,6 +41,8 @@ public function show(Request $request): Response
abort(404);
}

$page->logo_url = app(ThemeSettings::class)->getLogoUrl();

return Inertia::render('website/page/Show', [
'page' => function () use ($page) {
return FullPageResource::make($page);
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/Admin/CMS/MetadataResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function toArray($request)
'og_type' => $this->og_type,
'og_url' => $this->og_url,
'title' => $this->title,
'logo' => $this->title,
];
}
}
1 change: 1 addition & 0 deletions app/Http/Resources/Web/CMS/FullPageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function toArray($request)
'slug' => $this->slug,
'template' => TemplateResource::make($this->whenLoaded('template')),
'url' => UrlResource::make($this->whenLoaded('url')),
'logo_url' => $this->logo_url ?? null,
];

// Add content
Expand Down
24 changes: 24 additions & 0 deletions app/Models/Settings/ThemeSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ public static function group(): string
return 'theme';
}

public function getLogoUrl(): ?string
{
return $this->logo_url;
}

public function getFaviconUrl(): ?string
{
return $this->favicon_url;
}

public function getSiteName(): ?string
{
return $this->site_name;
}

public function getGeneralThemeSettingsArray(): array
{
return [
$this->favicon_url,
$this->logo_url,
$this->site_name,
];
}

public function getColorsAsCssArray(): array
{
$cssVars = ThemeInterface::ALL_COLORS_CSS_VARS;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading