Daud khan
Daud khan

Reputation: 2509

In Laravel how to add language part in all anchor links?

I am using blade template and put simple url like

<a href="aboutus">About us</a>

Now I change language like

mydomain.com/hn/

then how i can add language part in all url like

mydomain.com/hn/aboutus

Upvotes: 0

Views: 392

Answers (2)

Paolo Anghileri
Paolo Anghileri

Reputation: 457

Take a look at Laravel localization. It may be useful to you. Laravel Localization

Upvotes: 1

lewis4u
lewis4u

Reputation: 15047

Try to create a link like this

<a href="/aboutus/hn">About us</a>

and then in routes/web.php make a route for it like this

Route::get('aboutus/hn', function () {
    return 'About us page';
});

Upvotes: 0

Related Questions