Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Larecipe Rtl Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Confirm you actually need it. This is the official RTL stylesheet/enabler for LaRecipe. If your docs are LTR-only, you don't. If you ship Arabic, Hebrew, Persian, or Urdu docs, this is the shortest path to a mirrored layout — but see the archive warning below before committing.
  2. Install LaRecipe first. This package is a satellite; it assumes binarytorch/larecipe is already installed, configured, and publishing docs. Get a stock LaRecipe docs site rendering before you add RTL.
  3. Install the RTL package:
    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.
  4. Register the provider if not auto-discovered. Older Laravel versions and this generation of packages don't always declare extra.laravel.providers. Look in config/app.php and add the provider manually if the RTL styles don't appear.
  5. Publish and inspect. The service provider almost certainly publishes a CSS asset or overrides a LaRecipe view. Run:
    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.
  6. First real use case: a docs site where the sidebar, TOC, breadcrumbs, and body text all read right-to-left for an Arabic-speaking audience, using the same Markdown source as your English docs.

Implementation Patterns

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.

Gotchas and Tips

  • Archived since 2019. There will be no fixes for Laravel 6+ service-provider signatures, missing boot/register return types, or @vite-era asset handling. Treat it as reference material, not a maintained dependency.
  • LaRecipe version drift. LaRecipe 2.x reorganised its UI and asset pipeline. An RTL patch written for 1.x will at best half-apply and at worst break the sidebar layout silently. Verify the CSS selectors actually match the current LaRecipe DOM before assuming it works.
  • Asset caching masks changes. After publishing or editing RTL CSS:
    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.
  • Use --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 blocks look wrong in RTL. LaRecipe renders highlighted code and inline 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.
  • Icons and chevrons don't flip. Sidebar expand arrows, breadcrumb separators, and search icons are typically font-glyph or SVG; they need transform: scaleX(-1) or a swapped icon set. Check the sidebar tree and TOC specifically.
  • Debug with the DOM, not the source. Open devtools, confirm the RTL stylesheet is actually loaded (Network tab) and that its rules are applied (a 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.
  • Extension points are thin. This package is essentially a stylesheet plus a provider. Anything beyond that — per-page direction, mixed LTR/RTL content, locale switcher UI — is yours to build in the host app. Budget for custom CSS rather than expecting the package to cover it.
  • Migration tip. If you inherit a project using this, pull the published CSS into your own repo, remove the composer requirement, and add a regression test asserting dir="rtl". That's a 30-minute change that removes an archived dependency from your composer.lock.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle