PHPackages                             suavy/loja-for-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. suavy/loja-for-laravel

ActiveLibrary

suavy/loja-for-laravel
======================

1.0.15(5y ago)4133MITPHPPHP ^7.3CI failing

Since Sep 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/suavy/loja-for-laravel)[ Packagist](https://packagist.org/packages/suavy/loja-for-laravel)[ Docs](https://github.com/suavy/loja-for-laravel)[ RSS](/packages/suavy-loja-for-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (18)Used By (0)

LOJA is the beginning of your custom ecommerce on Laravel
=========================================================

[](#loja-is-the-beginning-of-your-custom-ecommerce-on-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7e4f4aaa3f3918bbaa178d510530065dfadff90ead54acd992f5f3a47887b58b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756176792f6c6f6a612d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suavy/loja-for-laravel)[![Build Status](https://camo.githubusercontent.com/6fae8715ae3767393a2c172160be093325ece6db02ef2999a8e96ef5e8df22ea/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73756176792f6c6f6a612d666f722d6c61726176656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/suavy/loja-for-laravel)[![Quality Score](https://camo.githubusercontent.com/782e3d1ee7b78d92fa95119dcdbac0a107dd1911f8fb5e40d8a26de083db9261/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73756176792f6c6f6a612d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/suavy/loja-for-laravel)[![Total Downloads](https://camo.githubusercontent.com/3180b886e50e4f624e007d904a2d2ea2e9d89a80daad65842929260085ce5ea2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756176792f6c6f6a612d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suavy/loja-for-laravel)

LOJA is a [Laravel](https://laravel.com/) package that help you add eCommerce features to your working Laravel application. LOJA comes with a functional backend (easy to add on existing [Backpack](https://backpackforlaravel.com/) admin panel, or in a new one) and a DIY frontend.

**⚠️ THIS IS CURRENTLY IN DEVELOPMENT AND NOT WORKING**

Installation
------------

[](#installation)

1️⃣ Install the package via composer:

```
composer require suavy/loja-for-laravel
```

> Please, note that the package is made for [Backpack for Laravel](https://backpackforlaravel.com/) which is free for non-commercial use only.

2️⃣ Follow the [Backpack for Laravel](https://backpackforlaravel.com/) installation first if you don't have it already in your project. If you are not familiar with Backpack, it's time to start!

3️⃣ Publish BackpackSettings files (official Backpack addon)

```
php artisan vendor:publish --provider="Backpack\Settings\SettingsServiceProvider"
```

4️⃣ Publish our files (that include config file, migrations and views)

```
php artisan vendor:publish --provider="Suavy\LojaForLaravel\LojaForLaravelServiceProvider"
```

> Please, before continuing, get a look at `config/loja.php` and fill it! Some configuration are required, so don't forget to do it

5️⃣ Migrate your database

```
php artisan migrate
```

6️⃣ Add our LOJA Admin Sidebar to your current Backpack sidebar (located at `ressources/views/vendor/backpack/base/inc/sidebar_content.blade.php`)

```
@include('loja::admin.sidebar')
```

7️⃣ We use Laravel Livewire for some dynamic components (instead of Vue or React), to make theses components work, you need to first include their javascript using their custom blade directives.

```

    ...
    @livewireStyles

    ...
    @livewireScripts

```

8️⃣ Add HasAddress trait to user model

```
use Suavy\LojaForLaravel\Traits\HasAddress;

class User extends ...
{
    use HasAddress;
}
```

9️⃣ Add button to backpack admin in views/vendor/backpack/crud/buttons/toggle-country.blade.php // TODO Trie to remove this step

```
@include('loja::admin.crud.buttons.toggle-country')
```

Installation is done now 🎉

Usage
-----

[](#usage)

### Backend

[](#backend)

> Everything was already done during the installation. So you can start using your backend now 🚀

### Frontend (Do It Yourself)

[](#frontend-do-it-yourself)

LOJA only create empty views (except for the cart page that is included), but in each view you have access to the needed variables and their attributes to make your own frontend views.

> You can add a prefix to every LOJA routes updating the `routes_prefix` on config file.

#### GET routes

[](#get-routes)

routeroute nameviewvariables/cartloja.cart.index.../cart/index.blade.php$cart--.../cart/empty.blade.php-/categoriesloja.category.index.../category/index.blade.php$categories/category/{category}loja.category.show.../category/show.blade.php$category/collectionsloja.collection.index.../collection/index.blade.php$collections/collection/{collection}loja.collection.show.../collection/show.blade.php$collection/payment/successloja.payment.success.../cart/payment-success.blade.php$cart/payment/cancel**redirects to /cart with message**--/product/{product}loja.product.show.../product/show.blade.php$product, $relatedProducts/search?...loja.search.../search/index.blade.php$products/user/ordersloja.user.order.index.../user/order/index.blade.php$orders/user/order/{order}loja.user.order.show.../user/order/show.blade.php$order> Empty views are located at `resources/views/vendor/loja/`

#### Components

[](#components)

namedescription"Loja Add To Cart"this components must be added in every product page (loja.product.show)#### POST routes

[](#post-routes)

route nameparametersdescriptionloja.cart.product.add$product, $quantityadd a product to cartloja.cart.product.remove$productremove a product from cartloja.cart.empty-empty the cartloja.cart.product.update.quantity$product, $quantityupdate product cart quantity#### Helper features (available everywhere)

[](#helper-features-available-everywhere)

helper functiondescriptionloja\_categoriesreturn a Collection of categoriesloja\_collectionsreturn a Collection of collectionsloja\_products($params)return a Collection of products

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~0 days

Total

16

Last Release

1928d ago

PHP version history (2 changes)1.0.0PHP ^7.2.5

1.0.6PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ffd1d6768342609ec647d13b27f823c923454b83ec8967843d05bcdfd4427c4?d=identicon)[cdo9](/maintainers/cdo9)

---

Top Contributors

[![cdo9](https://avatars.githubusercontent.com/u/5813412?v=4)](https://github.com/cdo9 "cdo9 (338 commits)")[![lemattou](https://avatars.githubusercontent.com/u/27729138?v=4)](https://github.com/lemattou "lemattou (103 commits)")[![obrenoco](https://avatars.githubusercontent.com/u/58960887?v=4)](https://github.com/obrenoco "obrenoco (4 commits)")[![Manoob9](https://avatars.githubusercontent.com/u/64142704?v=4)](https://github.com/Manoob9 "Manoob9 (3 commits)")[![kyrog](https://avatars.githubusercontent.com/u/44094460?v=4)](https://github.com/kyrog "kyrog (1 commits)")

---

Tags

suavyloja-for-laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/suavy-loja-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/suavy-loja-for-laravel/health.svg)](https://phpackages.com/packages/suavy-loja-for-laravel)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
