PHP code example of invisnik / laravel-steam-inventory

1. Go to this page and download the library: Download invisnik/laravel-steam-inventory library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

invisnik / laravel-steam-inventory example snippets


'providers' => [
	// ...
	Invisnik\LaravelSteamInventory\ServiceProvider::class,
]

namespace App\Http\Controllers;

use Invisnik\LaravelSteamInventory\SteamInventory;

class YourController extends Controller
{
    /**
     * @var SteamInventory
     */
    private $steamInventory;

    public function __construct(SteamInventory $steamInventory)
    {
        $this->steamInventory = $steamInventory;
    }

    public function index()
    {
    	$user = App\User::find(1);
	// $user->steamid = '76561198233097000'
    	$items = $this->steamInventory
		->loadInventory($user->steamid, 730)->getInventoryWithDescriptions();
		
	return view('your.view.file', compact('items'));
    }
}

php artisan vendor:publish