PHP code example of davesweb / laravel-bricklink-api
1. Go to this page and download the library: Download davesweb/laravel-bricklink-api 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/ */
davesweb / laravel-bricklink-api example snippets
namespace App\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Davesweb\BricklinkApi\Repositories\CategoryRepository;
class CategoryController extends Controller
{
public function index(CategoryRepository $repository): Renderable
{
$categories = $repository->index();
return view('categories.index', [
'categories' => $categories,
]);
}
}
namespace App\Http\Controllers;
use App\Http\Requests\StoreCouponRequest;
use Illuminate\Contracts\Support\Renderable;
use Davesweb\BricklinkApi\Repositories\CouponRepository;
use Davesweb\BrinklinkApi\Transformers\CouponTransformer;
class CouponController extends Controller
{
public function store(StoreCouponRequest $request, CouponRepository $repository, CouponTransformer $transformer): Renderable
{
$coupon = $transformer->toObject($request->validated());
$newCoupon = $repository->store($coupon);
return redirect()->back()->with('success', 'Succesfully created the new coupon ' . $newCoupon->couponId . '.');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.