Laravel 4 how to apply title and meta information to each page with blade master page
This works as well:
master.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<title>@yield('title')</title>
<meta name="description" content="@yield('description')">
</head>
individual page
@extends('layouts.master')
@section('title')
This is an individual page title
@stop
@section('description')
This is a description
@stop
@section('content')
or if you want to shorten that some more, alternately do this:
individual page
@extends('layouts.master')
@section('title', 'This is an individual page title')
@section('description', 'This is a description')
@section('content')
This should work:
@extends('layouts.master')
<?php View::share('title', 'title'); ?>
...
You can also do this:
@extends('views.coming-soon.layout', ['title' => 'This is an individual page title'])
Really recommend this:
https://github.com/artesaos/seotools
You pass the information to the the view require the content
SEOTools::setTitle($page->seotitle);
SEOTools::setDescription($page->seodescription);