Refactor code for generating title in layout view
MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<!DOCTYPE html>
<html>
<head>
- @if (View::hasSection('title')) <title>@yield('title') - {{ config('app.name') }}</title> @else <title>{{ config('app.name') }}</title> @endif
+ <title>{{ View::hasSection('title') ? View::getSection('title') . ' - ' . config('app.name') : config('app.name') }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/storage/fontawesome/all.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:400,400i,600,600i" />

Refactor code for generating title in layout view