Back to Top

Laravel NFT Marketplace Module

Updated 17 December 2024

INTRODUCTION

Transform your Bagisto store into a Non-Fungible Marketplace with the PHP NFT Marketplace Script for Laravel NFT Marketplace module.

This NFT Marketplace, encourage merchants from diverse categories to sell digital collectibles from a single storefront.

Features of NFT Marketplace:

  • An attractive & intuitive Storefront for NFT Marketplace.
  • Storefront will contain information as previews, price history, bids and owner’s information, etc. 
  • Separate seller and buyer account inside
  • User can create and sell collectibles 
  • NFT Marketplace platform gives you the opportunity to bid on your listed NFTs.
  • Here you need to setup the Wallet first, named MetaMask 
  • NFT marketplace platform will provide you to search the items or tokens
  • Rating will help beginners to understand the real worth of collectibles. 

Please Note:

Laravel NFT Marketplace is supported by Bagisto v1.3.2 or higher.

Admin can also select between the default theme and the Velocity theme.

Searching for an experienced
Laravel Company ?
Find out More

Installation of NFT Marketplace 

Customers will get a zip folder after purchasing the extension. You need to unzip the respective extension zip and then merge “packages” & “NFTMarketplace” folders into the project root directory.

Installation of NFT Marketplace 

Goto config/app.php file and add following line under ‘providers’.

Webkul\NFTMarketplace\Providers\NFTMarketplaceServiceProvider::class

 Goto composer.json file and add following line under ‘psr-4’

"Webkul\\NFTMarketplace\\": "packages/Webkul/NFTMarketplace/src"

Now you need to goto config/concord.php file and add following line under ‘modules’

'modules' => [
    ...

    \Webkul\NFTMarketplace\Providers\ModuleServiceProvider::class,

    ...
]
Installation of NFT Marketplace 

Goto config/auth.php file and add following line under ‘guards’.

'guards' => [
    ...

    'wallet' => [
        'driver'   => 'session',
        'provider' => 'wallets',
    ],

    ...
]
Installation of NFT Marketplace 

Similarly, in the config/auth.php file you need to add following line under ‘providers’.

'providers' => [
    ...

    'wallets' => [
        'driver' => 'eloquent',
        'model'  => Webkul\NFTMarketplace\Models\Wallet::class,
    ],

    ...
]
Installation of NFT Marketplace 

Next, you need to run below commands in the terminal to complete the setup.

composer require kornrunner/keccak --ignore-platform-reqs

composer require simplito/elliptic-php --ignore-platform-reqs

composer dump-autoload

php artisan migrate

php artisan route:cache

php artisan vendor:publish ( press 0 and then press enter to publish all assets and configurations.)

Laravel NFT Marketplace Configuration

Goto packages/Webkul/NFTMarketplace folder and run the following command to install npm dependencies

npm install

Run the following command to test smart contract

npx hardhat test

Deploying the Smart Contract

Goto hardhat.config.js file and setup configuration and run the following command to deploy smart contract on specified network and for locally contract deployment runs the following commands.

Deploying contract to a Local Network

For locally contract deployment runs the following commands

npx hardhat node

npx hardhat run scripts/deploy.js --network localhost

Deploying contract to a Live Network

For live network contract deployment runs the following command

npx hardhat run scripts/deploy.js --network ropsten

IPFS Storage

Pinata is one of the most popular storage platform. To use Pinata you need to sign up for an account.

  • Head over to pinata.cloud 
  • Click Sign up and use your email address to create an account.

Get an API key

You need to grab an API key from Pinata. Your API key allows NFTs to interact with your Pinata account automatically.

  • Log into Pinata and select API keys from the sidebar menu.
  • Click New Key.
  • Expand the Pinning Services API drop-down and select all the options under Pins
  • Pinata will give you an API key, and API secret.

Furthermore, goto .env file and add following lines and run the following commands. You can see in the below image.

NFT_PRODUCT_CONTRACT_ADDRESS=

NFT_IPFS_SERVICE=pinata

NFT_IPFS_KEY=

NFT_IPFS_SECRET= 

Installation of NFT Marketplace 

**For dropped/pending transactions run the following command in background:

node packages/Webkul/NFTMarketplace/scripts/transaction.js

General Settings

Now we will set the default theme from backend admin panel of Bagisto, for that Go to channels –> edit channels and reset the theme of Bagisto as “default”.

Create an Ethereum Account to Setup MetaMask Wallet

We need an Ethereum account to send and receive transactions. First you need to install and setup Metamask Wallet for the browser. We will add the extension in our browser first.

Create Account

After setting up the wallet , you can create and edit the profile by clicking on Account.

User GInstallation of NFT Marketplace uide of Bagisto NFT marketplace
Create Account

Edit profile

Let’s move on with each functionality.

Wallet Address: An ethereum address is a unique identifier that serves as a virtual location for your ether and ethereum-based tokens. Think of it like your bank account number.

Title: Here, you need to put the title of the profile.

User Name: By default the user name would be same as the wallet address.

BIO: In this section, you need to put the description of the profile.

Edit profile in NFT
Edit Profile

Media: In media you can put social media links for facebook, linkedin instagram etc.

Logo: Here you need to put the logo of your profile.

Create NFT

After creating the profile, you need to mint the NFT in the marketplace.

Upload Media: First you need to put the media as image, video, audio and 3D model for creating the NFT.

SKU: Now you need to put the SKU of the NFT which you want to create.

Name: Put name of the NFT

Short Description: Here you need to put the short description.

Description: In this section, describe about your NFT.

Create NFT
Create NFT

List Item

After listing your desired NFT into the marketplace, you’ll have two option for sell that NFT.

  • Fixed Price
  • Timed Auction

Fixed Price

“Fixed price” is like creating a store listing — you set a price for your NFT, and if someone wants to pay that price, they can just buy it. On the listing page, you can choose to set a fixed price for the item.

List Item
Fixed Price

Timed Auction

You can also opt for a timed auction, which requires interested buyers to outbid themselves to acquire the item. Furthermore, you can set a duration for the sales or reserve the NFT for a specific buyer.

Starting Price: Creators set a starting price for the auction and buyers must place bids at or above this price.

Reverse Price: The reserve price is the minimum amount you will be willing to receive for your NFT on auction.

Auction Time: You can set starting and ending date for the auction.

List Item
Timed Auction

Commision fee during transaction

  • While listing the item into the NFT marketplace, you need to pay 0.025ETH commision fee to the original creator of the NFT.
  • You can also reset the commision fee from the Smart Contract. For that, you need to goto packages/Webkul/NFTMarketplace/contracts/NFTProduct.sol from there you can reset commision.

List NFT

Buy and Sell NFT

After listing the NFT, you will list the items, then you can buy and sell the NFT. You can see created by and owned by NFT.

Buy NFT

Now you’re ready to bid on and buy NFTs. Let’s go back to Bagisto NFT Marketplace. You can browse art or collectibles from the category then You’ll find all sorts of artwork for sale. To buy the collectibles you need to click over Buy Now button then confirm checkout.

Buy NFT

Next you have to confirm the gas fee. This is required by the Ethereum network to process the transaction.

Buy NFT

Sell NFT

To sell the collectibles you need to click over sell button then confirm checkout. Next you have to confirm the gas fee. After selling the NFTs the funds will transfer to your digital wallet. Furthermore, you can use them to buy other NFTs.

Sell NFT

Transaction Details of NFTs on Etherscan

You can check NFTs transaction details over Etherscan, where you can see Transaction hash, Status, Token Id, Token Standard and Blockchain information etc.

NFTs transaction detail over Etherscan


Support

In this tutorial, We have learned , how to install, create and mint the NFT in Laravel NFT Marketplace. Hope you find the guide helpful! Please feel free to share your feedback in the comments below.

Build your own NFT marketplace with our customizable PHP NFT Marketplace Script. Easy integration, secure transactions, and scalable features.

You can raise a ticket at  https://webkul.uvdesk.com/en/customer/create-ticket/.

For any doubt, contact us at [email protected].

Thanks for paying attention!!

Current Product Version - Bagisto v1.3.2 or higher

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home

Table of Content