Skip to content

Commit

Permalink
Merge pull request #81 from sigi-ro/feature/new-requests
Browse files Browse the repository at this point in the history
Changes for logo and small impro
  • Loading branch information
dorusomcutean committed Apr 1, 2024
2 parents a50fb4e + 997e0ba commit 2bb21df
Show file tree
Hide file tree
Showing 135 changed files with 667 additions and 608 deletions.
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

0 comments on commit 2bb21df

Please sign in to comment.