1. Go to this page and download the library: Download edulazaro/laratext library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
'context' => 'A real estate CRM used by estate agents. Address the user formally. Never translate the product names Inmoqueen or Laratext.',
text('key_name', 'default_value');
@text('key_name', 'default_value')
// PHP usage with auto-generated text
text('hello_mate'); // Auto-generates: "Hello Mate"
text('welcome_back'); // Auto-generates: "Welcome Back"
text('user.first_name'); // Auto-generates: "First Name" (uses last part after dot)
// PHP - displays text as-is with placeholders
echo text('welcome.user', 'Welcome, :name!');
// Output: "Welcome, :name!"
// PHP - replaces placeholders with actual values
echo text('welcome.user', 'Welcome, :name!', ['name' => 'John']);
// Output: "Welcome, John!" (or "¡Bienvenido, John!" in Spanish)
echo text('items.count', 'You have :count items.', ['count' => 5]);
// Output: "You have 5 items." (or "Tienes 5 artículos." in Spanish)
text('items.count', 'One item|You have :count items', ['count' => $n]);
text('items.count', '{0} No items|[1,19] You have :count items|[20,*] You have plenty', ['count' => $n]);
php artisan laratext:scan --write
// The scanner sees nothing here
return text("activity.{$this->type->value}", $default);
// It sees every key here
return match ($this->type->value) {
'created' => text('activity.created', ':actor created :item'),
'deleted' => text('activity.deleted', ':actor deleted :item'),
};