Ad

Laravel: Translate String In @section

- 1 answer

My blade template looks like this:

@extends('layouts.main')

@section('title', 'Houses')

@section('content')
<div class="row">
... etc

If I want to translate the title like this:

@section('title', {{ __('Houses') }})

I get this error:

Facade\Ignition\Exceptions\ViewException syntax error, unexpected '<', expecting ')' (View:

How should I correctly translate string in @section ?

Ad

Answer

Try this:

@section('title', __('Houses'))
Ad
source: stackoverflow.com
Ad