Advertisement ยท 728 ร— 90
#
Hashtag
#LaraFoundry
Advertisement ยท 728 ร— 90

Multilanguage (i18n) for SaaS shouldn't be a headache. ๐ŸŒ

Just shared my production-ready system for #LaraFoundry:

Dual-layer: DB (Auth) vs Cookies (Guest)

5-level detection chain (IP, Browser, Session)

Seamless Inertia + Vue 3 integration

Deep dive

#Laravel #VILstack #BuildInPublic #PHP

2 0 0 0

Two separate middleware flows for i18n in LaraFoundry:

Auth users: locale saved in DB, persists across devices
Guests: locale in cookie (10-year expiry), detected via IP + browser

Different persistence strategies. Same detection chain. Same result.

#Laravel #SaaS #LaraFoundry #WebDev

4 0 1 0

LaraFoundry ships with built-in content translation via DeepL + Google Translate.

One interface, two providers. Swap in config:

'translator_default' => env('TRANSLATION_SERVICE', 'deepl')

Your code doesn't care which API it calls. The contract handles it.

#Laravel #DeepL #API #LaraFoundry

2 0 0 0

How I pass translations from Laravel to Vue without extra API calls:

HandleInertiaRequests middleware shares locale + translations as props. vue-i18n picks them up. Global t() function available everywhere.

{{ t('Dashboard') }} - done.

#Laravel #Vue #Inertia #LaraFoundry

1 0 0 0

The entire frontend i18n setup in LaraFoundry

That's literally it. No per-component imports.

#Laravel #Vue #JavaScript #LaraFoundry

2 0 0 0

Fun detail: LaraFoundry detects user's country from IP on first visit and auto-sets the language.

Ukrainian IP -> Ukrainian UI. No clicks needed.

The country_locale_map in config makes it dead simple to customize.

#SaaS #LaraFoundry #i18n #PHP

1 0 0 0

The locale detection chain in LaraFoundry:

1. User's saved preference (DB)
2. Session
3. Browser Accept-Language
4. IP geolocation (ip-api.com)
5. Default

Runs on every request. Detection happens once, then it's cached in session + cookie + DB.

#Laravel #i18n #LaraFoundry

0 0 0 0

"We'll localize it later."

Every SaaS project ever.

I just built a full multilanguage system for LaraFoundry - my Laravel SaaS framework.

Auto-detects language from browser + IP geolocation. 4 languages ready. Zero config for the user.

Thread coming this week.

#BuildInPublic #LaraFoundry #i18n

2 1 1 1

LaraFoundry update: 5 modules shipped. ๐Ÿš€

โœ… Registration
โœ… Authentication
โœ… Multi-tenancy (Native)
โœ… Logging (Activitylog + Custom)
โœ… Multilanguage (i18n)
๐Ÿ—๏ธ Next: Navigation & Menu System

Building a battle-tested core in public so you don't have to.

Join the journey ๐Ÿ‘‡

#LaraFoundry #SaaS #PHP

2 0 1 10

LaraFoundry Logging module recap:

- spatie/laravel-activitylog (extended)
- jenssegers/agent (device detection)
- opcodesio/log-viewer (web UI)
- laravel/telescope (dev debugger)
- Async geolocation via queued jobs
- 60+ events,zero manual log calls

#LaraFoundry #BuildInPublic #Laravel #OpenSource

3 1 0 1

Testing event-driven logging means testing the full chain:

User action -> Event -> Listener -> Service -> DB record -> Geo job

Each link can break independently. each link gets its own test.

A logging system that silently breaks is worse than no logging.

#Laravel #PestPHP #Testing #LaraFoundry

1 0 0 0

"We'll add logging later."

Famous last words in every SaaS project.

In LaraFoundry, logging is a Day 1 feature. Not an afterthought.

60+ events. Device fingerprinting. Geolocation. All automatic.

Thread below
www.linkedin.com/posts/dmitry...

#Laravel #SaaS #BuildInPublic #LaraFoundry

1 0 0 0

Building LaraFoundry: A modular Laravel core to kickstart your next SaaS. ๐Ÿ› ๏ธ

Current status:
โœ… Auth & Permissions
โœ… Multi-tenancy (no-package)
โœ… Logging Module (New!)
๐Ÿ—๏ธ Next module in progress...

Shipping in public. Join the journey! ๐Ÿ‘‡

#SaaS #Laravel #BuildInPublic #LaraFoundry

4 0 2 13

LaraFoundry Multi-Tenancy Module:

- 1 trait for data isolation
- 100+ permissions
- 8 Gates
- 5 role templates
- 3 middleware components
- 5-level permission hierarchy
- Smart menu filtering + FAR pattern
- 19 test files

All battle-tested on Kohana.io.

#LaraFoundry #Laravel #MultiTenancy

1 0 0 0

Company A cannot touch Company B. Period. 19 test files proving it.

#LaraFoundry #Laravel #Security #Testing

1 0 0 0

This single Pest test proves the override system works

Revoke beats role. Grant beats role. Hierarchy intact.

#LaraFoundry #Laravel #Testing #PestPHP

1 0 0 0

Each user can set their own landing page per company.

Storekeeper -> "Warehouse report"
Manager -> "Orders report"

If permissions change and that page becomes inaccessible? Auto-cleared. User gets notified. Falls back to next available page.

#LaraFoundry #Laravel #SaaS #UX

1 0 0 0

User bookmarks Orders page. Owner removes their orders permission. User clicks bookmark.

Most SaaS: 403 page.
LaraFoundry: redirect to first accessible page + flash message.

I call it the FAR pattern - First Allowed Route. Zero 403 pages in production.

#LaraFoundry #Laravel #UX #BuildInPublic

2 0 0 0

In LaraFoundry, if you can't access a page-you don't see it in the menu.
Every menu item has a 'policyName'. Every request runs 'checkUserAndCompanyPolicy'.

A Storekeeper sees: Warehouse.
A Manager sees: Orders, Production, Contragents.
An Owner sees: everything.

#LaraFoundry #Laravel #Permissions

0 0 0 0

Active company stored in both session AND database.

Session = fast.
Database = reliable.

If session clears - middleware resolves from DB.
If DB is slow - session serves the request.

Belt and suspenders.

#LaraFoundry #Laravel #MultiTenancy #SaaS

1 0 0 0

LaraFoundry middleware chain for multi-tenancy:
1. SetActiveCompanyMiddleware - resolves tenant
2. CheckAccessMiddleware - ban + payment check
3. CheckCompanyAccess - owner-only gates

Order matters. Can't check permissions before you know the company.
#LaraFoundry #Laravel #Middleware #Architecture

0 0 0 0

Your Manager role has 'orders.delete'.
One specific manager shouldn't delete orders.

Solution: revoke that ONE permission for that ONE user.

No new role. No code change. Just 'is_revoked = true' in the pivot table.

#LaraFoundry #Laravel #Permissions #SaaS

1 0 0 0

When a company is created in LaraFoundry, 5 role templates are auto-cloned:

- Manager
- Accountant
- Storekeeper
- Logistician
- Worker

Company owner can customize all of them + create new ones. No developer needed.

#LaraFoundry #Laravel #SaaS #BuildInPublic

1 0 0 0

LaraFoundry permission priority:

1. Super Admin -> always true
2. Owner -> full company access
3. Revoked -> blocks even if role allows
4. Individual grant -> overrides role
5. Role-based -> inherited permissions

One method: 'hasPermissionTo()'. Five levels of logic.

#LaraFoundry #Laravel #RBAC

0 0 0 0

Simple permissions -> config file.
Complex authorization -> dedicated Gate classes.

Clean. Testable. Each module gets its own file.

#LaraFoundry #Laravel #Gates #CleanCode

0 0 0 0

100+ permissions in my SaaS. Zero in AuthServiceProvider.

All defined in one config file. All auto-registered as Gates on boot.

Sync with `php artisan permissions:sync`. Done.

#LaraFoundry #Laravel #Authorization #BuildInPublic

3 0 0 0

LaraFoundry's `BelongsToCompany` trait:

One trait on your model. Zero chance of data leaks. Global scope handles everything.

#LaraFoundry #Laravel #Eloquent #SaaS

0 0 0 0

The scariest bug in multi-tenant SaaS: showing Company A's data to Company B.

It only takes ONE forgotten `where('company_id', ...)`.

LaraFoundry solves this at the model level with a single trait. Automatic. Unforgettable.

#LaraFoundry #Laravel #MultiTenancy #Security

0 0 0 0

Every Laravel SaaS tutorial teaches you auth.

None of them teach you what happens after login:
- Which company does this request belong to?
- Can this user see the Orders page?
- What if they work for 2 companies?

I built a complete multi-tenancy system.

#LaraFoundry #Laravel #SaaS #BuildInPublic

2 1 0 0

LaraFoundry Authentication Module:

- 6 login methods (email, OAuth x3, QR code, PIN)
- 3 admin security layers
- 5 middleware components
- 0 third-party auth services
- Full Pest test suite

All extracted from a production SaaS (Kohana.io). All battle-tested.

#LaraFoundry #Laravel #BuildInPublic

1 1 0 0