A simple ecommerce package implementation for Laravel.
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require laramaster/nuclues
Now you're ready to start using the shoppingcart in your application.
First you need set up laravel default authentication in your application
This package has configuration files which can be configured to your needs.
Deploy the prooph config files to add your configuration for the prooph components.
php artisan vendor:publish --tag=public
Then you need migrate some table.
php artisan migrate
The shoppingcart gives you the following methods to use:
Of course you also want to get the product content. This is where you'll use the get
method. This method will return a Collection of ProductsItems which you can iterate over and show the content to your customers.
Product::get()
Suppose you want to get latest,oldest,featured,best selling,related products. So you can pass parameter in this method.
Product::get('latest') //Will get latest product
Product::get('oldest') //will get oldest product
Product::get('featured') //will get featured product
Product::get('best_selling') //will get best selling product
Product::get('random') //will get random product
Now you want to get 5 or 3 latest,oldest,featured,best_selling,random product then you can use in this method.
Product::get('latest',3) //will get latest 3 product
Product::get('oldest',5) //will get oldest 5 product
Product::get('featured',7) //will get featured 7 product
Product::get('best_selling',12) //will get best_selling 12 product
Product::get('random',15) //will get random 15 product
Now you want to get single product. So,you can use in this method. And you must be pass product subtitle not product id.
Products::details($product->subtitle)
If you use this method you can get previous and next product. You need pass product id in this method.
Product::pre_next($product->id)
If you want to get product by category then you can use this method.
Product::bycategory('categoryId',5) //First parameter will be your category id and second parameter will be how many product you want to get.
If you want to get product by subcategory then you can use this method.
Product::bysubcategory('subcategoryId',5) //First parameter will be your subcategory id and second parameter will be how many product you want to get.
You can use this method for get your cart item.
Cart::get()
You can use this method for add product in your cart
Cart::add(1,'product 1',100.00,4)
You can use this method for update cart
Cart::update(1,8)
You can use this method for get cart subtotal price.
Cart::subtotal()
You can use this method for get cart total price
Cart::total()
You can use this method for delete item from cart
Cart::remove(1)
You can use this method for total cart quantity
Cart::count()
This method will be check that you have any item in cart
Cart::has()
You can use this method for delete all item from cart
Cart::destroy()
You can use this method for get your wishlist item.
Wishlist::get()
You can use this method for add product in your wishlist
Wishlist::add(1,'product 1',100.00,4)
You can use this method for delete item from wishlist
Wishlist::remove(1)
You can use this method for total wishlist quantity
Wishlist::count()
This method will be check that you have any item in wishlist
Wishlist::has()
You can use this method for get your Compare item.
Compare::get()
You can use this method for add product in your Compare
Compare::add(1,'product 1',100.00,4)
You can use this method for delete item from Compare
Compare::remove(1)
You can use this method for total Compare quantity
Compare::count()
This method will be check that you have any item in Compare
Compare::has()
You can use this method for get blog item
Blog::get()
You can use this method for get single blog item
Blog::details(1)
Of course you also want to get the category content. This is where you'll use the get
method. This method will return a Collection of categories which you can iterate over and show the content to your customers.
Category::get()
Suppose you want to get latest,oldest category. So you can pass parameter in this method.
Category::get('latest') //Will get latest Category
Category::get('oldest') //will get oldest Category
Now you want to get 5 or 3 latest,oldest category then you can use in this method.
Category::get('latest',3) //will get latest 3 category
Category::get('oldest',5) //will get oldest 5 category
You can use this method for get subcategory by category
Category::get()->subcategory
This method will return coupon details
Coupon::get()
You can use this method for add coupon
Coupon::add('abc')
This method will check that this coupon code has in your application
Coupon::check('abc123')
You can use this method for get all currency
Currencies::get()
You can use this method for add currency in your application
Currencies::add('usd')
You can use this method for product currency price
Currencies::price(100.00)
You can use this method for check now which type currency has in your application
Currencies::codeCheck()
You can use this method for get all review of your single product
Review::get(1)
You can use this method for add review
$data = [
'product_id' => 1,
'name' => "Arafat Hossain",
'email' => "admin@example.com",
'rating' => 4,
'review' => "Wow! Nice product",
];
Review::add($data);
You can use this method for get rating of a product
Review::rating(1) //will get like 3.6/4.2/5
Of course you also want to get the slider content. This is where you'll use the get
method. This method will return a Collection of sliders which you can iterate over and show the content to your customers.
Slider::get()
Suppose you want to get latest,oldest slider. So you can pass parameter in this method.
Slider::get('latest') //Will get latest slider
Slider::get('oldest') //will get oldest slider
Now you want to get 5 or 3 latest,oldest slider then you can use in this method.
Slider::get('latest',3) //will get latest 3 slider
Slider::get('oldest',5) //will get oldest 5 slider
You can use this method for get site logo
Site::logo()
You can use this method for get site name
Site::name()
Of course you also want to get the page content. This is where you'll use the get
method. This method will return a Collection of pages which you can iterate over and show the content to your customers.
Page::get()
Suppose you want to get latest,oldest page. So you can pass parameter in this method.
Page::get('latest') //Will get latest page
Page::get('oldest') //will get oldest page
Now you want to get 5 or 3 latest,oldest page then you can use in this method.
Page::get('latest',3) //will get latest 3 page
Page::get('oldest',5) //will get oldest 5 page
Of course you also want to get the navigation content. This is where you'll use the get
method. This method will return a Collection of navigations which you can iterate over and show the content to your customers.
Navigation::get()
Suppose you want to get latest,oldest Navigation. So you can pass parameter in this method.
Navigation::get('latest') //Will get latest Navigation
Navigation::get('oldest') //will get oldest Navigation
Now you want to get 5 or 3 latest,oldest Navigation then you can use in this method.
Navigation::get('latest',3) //will get latest 3 Navigation
Navigation::get('oldest',5) //will get oldest 5 Navigation
You can use this method for get navigation menu
Navigation::menu('Home')
You can use this method for add subscriber
Subscriber::add('admin@email.com')
You can use this method for add information in contact list
Contact::add('Arafat','admin@example.com','I need contact with you','Hello Arafat!')
Of course you also want to get the widget content. This is where you'll use the get
method. This method will return a Collection of widgets which you can iterate over and show the content to your customers.
Widget::get()
Suppose you want to get latest,oldest widget. So you can pass parameter in this method.
Widget::get('latest') //Will get latest widget
Widget::get('oldest') //will get oldest widget
Now you want to get 5 or 3 latest,oldest widget then you can use in this method.
Widget::get('latest',3) //will get latest 3 widget
Widget::get('oldest',5) //will get oldest 5 widget
You can use this method for get a single method
Widget::byname('Shop Widget')
You can use this method for check that if User will be admin then he can access this controller
Admin::is()
You can use this method for get all order item
Order::get()
First you need add stripe package.
Run the Composer require command from the Terminal:
composer require cartalyst/stripe-laravel
Add follow cartalyst/stripe-laravel
package requirment
You can use this method for add order
$data = [
'user_id' => 1,
'first_name' => "Arafat",
'last_name' => "Hossain",
'email' => "admin@example.com",
'phone' => 0175694...,
'address' => "Kirtipur",
'country' => "Bangladesh",
'city' => "Rajshahi",
'state' => "Naogaon",
'postal_code' => 6500,
'total_amount' => Cart::total(),
'payment_type' => "stripe",
'currency_type' => Currencies::type(),
'stripeToken' => $request->stripeToken, //It's will be stripe token
];
Order::add($data);
The Laravel Nuclues package is open-sourced software licensed under the MIT license