Astrotomic / laravel-translatable

A Laravel package for multilingual models

Home Page:https://docs.astrotomic.info/laravel-translatable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I want to get the both name in english and arabic in blade

Enadabuzaid opened this issue · comments

public function index() { $categories = Category::withTranslation()->paginate(15); return view('dashboards.admin.categories.index' , compact('categories')); }

Hello! You can use translate method to translate your model to specific language.

$bookEnglish = $book->translate('en')
$bookArabic = $book->translate('ar')