### Install Laravel Testimonial via Composer Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Install the package via Composer. Requires PHP 8.2+ and Laravel 12.x or 13.x. ```bash composer require jeffersongoncalves/laravel-testimonial ``` -------------------------------- ### Manage Translations with Spatie Translatable API Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Use the spatie/laravel-translatable API to get, set, list, and translate content for a specific locale. ```php $testimonial->getTranslation('content', 'pt_BR'); $testimonial->setTranslation('content', 'pt_BR', 'Recomendo muito!'); $testimonial->getTranslations('content'); // ['en' => '...', 'pt_BR' => '...'] $testimonial->translate('content', 'pt_BR'); ``` -------------------------------- ### Publish and Run Testimonial Migrations Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Publish the package migrations and run them to create the testimonials table. ```bash php artisan vendor:publish --tag="testimonial-migrations" php artisan migrate ``` -------------------------------- ### Run Package Tests Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Run the package test suite. ```bash composer test ``` -------------------------------- ### Create and Access a Testimonial Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Create a testimonial with translatable content and access the content attribute, which resolves for the current app locale with fallback. Only content is translatable; name, role, company, and avatar are plain strings. ```php use JeffersonGoncalves\Testimonial\Models\Testimonial; $testimonial = Testimonial::create([ 'name' => 'Jane Cooper', 'role' => 'CEO', 'company' => 'Acme Inc.', 'avatar' => 'avatars/jane-cooper.jpg', 'content' => ['en' => 'This product changed how we work.', 'pt_BR' => 'Este produto mudou a forma como trabalhamos.'], 'rating' => 5, 'order' => 1, 'is_active' => true, ]); $testimonial->content; // resolved for the current app locale, with fallback ``` -------------------------------- ### Publish Testimonial Config File Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Optionally publish the config file (config/testimonial.php) to customize table names and locales. ```bash php artisan vendor:publish --tag="testimonial-config" ``` -------------------------------- ### Query Active and Ordered Testimonials Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Use the active() and ordered() query scopes to retrieve active testimonials in the defined order. ```php Testimonial::active()->ordered()->get(); ``` -------------------------------- ### Configure Testimonials Table Name Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Configuration snippet showing how to override the testimonials table name. ```php 'table_names' => [ 'testimonials' => 'testimonials', ], ``` -------------------------------- ### Configure Supported Locales Source: https://github.com/jeffersongoncalves/laravel-testimonial/blob/main/README.md Configuration snippet that reads supported locales from app.available_locales, falling back to the app's default locale. ```php 'locales' => config('app.available_locales') ? array_keys(config('app.available_locales')) : [config('app.locale', 'en')], ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.