feat(Page title): add ability to set page title

This commit is contained in:
kusowl 2026-01-09 12:16:04 +05:30
parent d332cf8b2d
commit ff31bf55d7
3 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<x-layout>
<x-layout title="Login">
<section class="bg-linear-135 h-screen from-[#EFF6FF] to-[#FCF3F8] flex flex-col justify-center items-center wrapper">
<div class="mb-12 self-start">
<a href="{{route('home')}}" class="flex hover:underline">

View File

@ -1,7 +1,7 @@
@php
$options = \App\Enums\UserTypes::labels();
@endphp
<x-layout>
<x-layout title="Register">
<section
class="bg-linear-135 flex-1 overflow-y-scroll wrapper py-12 from-[#EFF6FF] to-[#FCF3F8] ">
<div class="flex flex-col items-center justify-center">

View File

@ -1,11 +1,18 @@
@props(['title' => ''])
@php
$pageTitle = config('app.name', 'Laravel');
if ($title !== ''){
$pageTitle = "$pageTitle | $title";
}
@endphp
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="h-full">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name', 'Laravel') }}</title>
<title>{{ $pageTitle }}</title>
<link rel="shortcut icon" type="image/x-icon" href="{{asset('storage/'.'/images/favicon.ico')}}" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />