Download the PHP package suavy/loja-for-laravel without Composer
On this page you can find all versions of the php package suavy/loja-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package loja-for-laravel
LOJA is the beginning of your custom ecommerce on Laravel
LOJA is a Laravel package that help you add eCommerce features to your working Laravel application. LOJA comes with a functional backend (easy to add on existing Backpack admin panel, or in a new one) and a DIY frontend.
:warning: THIS IS CURRENTLY IN DEVELOPMENT AND NOT WORKING
Installation
:one: Install the package via composer:
Please, note that the package is made for Backpack for Laravel which is free for non-commercial use only.
:two: Follow the Backpack for Laravel installation first if you don't have it already in your project. If you are not familiar with Backpack, it's time to start!
:three: Publish BackpackSettings files (official Backpack addon)
:four: Publish our files (that include config file, migrations and views)
Please, before continuing, get a look at
config/loja.php
and fill it! Some configuration are required, so don't forget to do it
:five: Migrate your database
:six: Add our LOJA Admin Sidebar to your current Backpack sidebar (located at ressources/views/vendor/backpack/base/inc/sidebar_content.blade.php
)
:seven: 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.
:eight: Add HasAddress trait to user model
:nine: Add button to backpack admin in views/vendor/backpack/crud/buttons/toggle-country.blade.php // TODO Trie to remove this step
Installation is done now :tada:
Usage
Backend
Everything was already done during the installation. So you can start using your backend now :rocket:
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
route | route name | view | variables |
---|---|---|---|
/cart | loja.cart.index | .../cart/index.blade.php | $cart |
- | - | .../cart/empty.blade.php | - |
/categories | loja.category.index | .../category/index.blade.php | $categories |
/category/{category} | loja.category.show | .../category/show.blade.php | $category |
/collections | loja.collection.index | .../collection/index.blade.php | $collections |
/collection/{collection} | loja.collection.show | .../collection/show.blade.php | $collection |
/payment/success | loja.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/orders | loja.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
name | description |
---|---|
"Loja Add To Cart" | this components must be added in every product page (loja.product.show) |
POST routes
route name | parameters | description |
---|---|---|
loja.cart.product.add | $product, $quantity | add a product to cart |
loja.cart.product.remove | $product | remove a product from cart |
loja.cart.empty | - | empty the cart |
loja.cart.product.update.quantity | $product, $quantity | update product cart quantity |
Helper features (available everywhere)
helper function | description |
---|---|
loja_categories | return a Collection of categories |
loja_collections | return a Collection of collections |
loja_products($params) | return a Collection of products |
All versions of loja-for-laravel with dependencies
anahkiasen/former Version ^4.4
backpack/crud Version 4.1.*
backpack/filemanager Version ^1.1
backpack/settings Version ^3.0
cartalyst/stripe-laravel Version ^13.0
darryldecode/cart Version ^4.1
illuminate/support Version ^8.0
pragmarx/countries Version ^0.7.0