### Install via Composer Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Install the package via Composer. ```bash composer require jeffersongoncalves/laravel-how-it-works ``` -------------------------------- ### Use Translatable API on Steps Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Uses the spatie/laravel-translatable API to get, set, list, and translate step fields. ```php $step->getTranslation('title', 'pt_BR'); $step->setTranslation('title', 'pt_BR', 'Crie uma conta'); $step->getTranslations('title'); // ['en' => '...', 'pt_BR' => '...'] $step->translate('title', 'pt_BR'); ``` -------------------------------- ### Publish and Run Migrations Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Publish and run the package migrations. ```bash php artisan vendor:publish --tag="how-it-works-migrations" php artisan migrate ``` -------------------------------- ### Create and Access a Step Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Creates a step with translatable title and description, then accesses the title with locale fallback. ```php use JeffersonGoncalves\HowItWorks\Models\Step; $step = Step::create([ 'icon' => 'heroicon-o-user-plus', 'title' => ['en' => 'Create an account', 'pt_BR' => 'Crie uma conta'], 'description' => ['en' => 'Sign up in seconds.', 'pt_BR' => 'Cadastre-se em segundos.'], 'order' => 1, 'is_active' => true, ]); $step->title; // resolved for the current app locale, with fallback ``` -------------------------------- ### Publish Config File Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Publish the optional config file. ```bash php artisan vendor:publish --tag="how-it-works-config" ``` -------------------------------- ### Run Tests Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Runs the package test suite. ```bash composer test ``` -------------------------------- ### Configure Table Names Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Configures the database table name for the steps. ```php 'table_names' => [ 'steps' => 'how_it_works_steps', ], ``` -------------------------------- ### Configure Locales Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Defines supported locales, reading from app.available_locales or falling back to the app locale. ```php 'locales' => config('app.available_locales') ? array_keys(config('app.available_locales')) : [config('app.locale', 'en')], ``` -------------------------------- ### Query Active and Ordered Steps Source: https://github.com/jeffersongoncalves/laravel-how-it-works/blob/main/README.md Retrieves active steps in the defined order using the active() and ordered() scopes. ```php Step::active()->ordered()->get(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.