binarytorch/larecipe-rtl
Adds right-to-left support to LaRecipe documentation pages, adjusting layout, typography and navigation for Arabic, Hebrew and other RTL languages. A small companion package for Laravel projects already publishing docs with LaRecipe.
binarytorch/larecipe is already installed, configured, and publishing docs. Get a stock LaRecipe docs site rendering before you add RTL.composer require binarytorch/larecipe-rtl
Check composer.json afterwards — the package was last tagged in April 2019 and pins/expects the LaRecipe 1.x era. On a fresh Laravel 9/10/11 app, expect a dependency-resolution fight or a silent no-op.extra.laravel.providers. Look in config/app.php and add the provider manually if the RTL styles don't appear.php artisan vendor:publish --provider="BinaryTorch\\LarecipeRtl\\LarecipeRtlServiceProvider"
then diff the published files against LaRecipe's own resources/views and public/vendor/larecipe output to see exactly what got swapped.Copy the CSS, drop the package. Given the archive status and 0 dependents, the pragmatic pattern most teams adopt is to vendor the RTL stylesheet into resources/css/ of the host app and include it conditionally, rather than depending on a dead composer package. You keep the visual result and lose the abandoned dependency.
Locale-conditional loading. The common integration is to switch the RTL asset on when the active locale is in an RTL set:
// in a view composer or the docs layout
$isRtl = in_array(app()->getLocale(), ['ar', 'he', 'fa', 'ur']);
Then set <html dir="{{ $isRtl ? 'rtl' : 'ltr' }}"> and conditionally include the RTL CSS after LaRecipe's base stylesheet so it wins on specificity order.
Per-locale documentation trees. LaRecipe lets you point at different docs paths; pair that with a locale-aware route prefix (/ar/docs/..., /en/docs/...) and load the RTL stylesheet only under the RTL prefix. This keeps English and Arabic docs side by side without a build step.
Override, don't fork. If the package overrides Blade views, prefer publishing LaRecipe's views into resources/views/vendor/larecipe and editing them there. That centralises your customisation and makes it obvious what is LaRecipe and what is RTL hackery.
Pair with a locale middleware. A tiny SetLocale middleware reading a session or Accept-Language header is the usual companion. The RTL package has no opinion on routing; keep locale detection in your app, not in the package.
CI smoke test. Render one Arabic page in a feature test and assert dir="rtl" is present in the response. Cheap, and it catches asset-publish regressions on every Laravel upgrade.
boot/register return types, or @vite-era asset handling. Treat it as reference material, not a maintained dependency.php artisan config:clear && php artisan view:clear && php artisan cache:clear
and hard-refresh the browser. Stale public/vendor/larecipe files are the single most common "it doesn't work" cause.--force carefully. Re-publishing LaRecipe's assets will overwrite your RTL CSS if they share paths. Keep your RTL stylesheet at a distinct filename (larecipe-rtl.css) so publishes don't clobber it.code; without explicit direction: ltr; text-align: left on pre, code, fenced blocks mirror and become unreadable. Add that rule yourself — the 2019 package predates most of these refinements.transform: scaleX(-1) or a swapped icon set. Check the sidebar tree and TOC specifically.dir="rtl" attribute on <html> is not enough if LaRecipe's own rules are more specific). If rules are greyed out, bump specificity or move your stylesheet later in the cascade.dir="rtl". That's a 30-minute change that removes an archived dependency from your composer.lock.How can I help you explore Laravel packages today?