Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.2 - Metatag canonical Url

i'm tryng to integrate metatags in my layout laravel,

app.layouts

<title>SiRegala.it - @yield('title')</title>
<meta name="description" content="@yield('description')"/>
<link rel="canonical" href="@yield('canonical')"/>

view

@section('title')
Homepage
@stop
@section('canonical') 
<?php echoURL::current(); ?>
@stop

i'm tryng to get current url of my view, but actually i get this error:

Class 'echoURL' not found

How can i get Current URL ? maybe with blade? i tryed to search some solution with blade but i did not find nothing.

Thank you for your help!

like image 728
Diego Cespedes Avatar asked Dec 01 '22 15:12

Diego Cespedes


1 Answers

Laravel 5.7

<link rel="canonical" href="{{ url()->current() }}" />
like image 193
Farid Movsumov Avatar answered Dec 11 '22 10:12

Farid Movsumov