-
routes/web.php
Open in GitHubuse App\Http\Controllers\DownloadPurchasableController; // Route::prefix('products')->group(function () { // Route::get('{product:slug}/purchases/{purchase}/download/{file}', DownloadPurchasableController::class) ->middleware(['auth', 'signed']) ->name('purchase.download'); // }); //
-
resources/views/front/pages/products/partials/purchasedProduct.blade.php
Open in GitHub// @foreach($purchasable->getMedia('downloads') as $download) @php $downloadUrl = URL::temporarySignedRoute( 'purchase.download', now()->addMinutes(30), [$purchasable->product, $purchase, $download] ); @endphp <div> <a class="link-blue link-underline" download="download" href="{{ $downloadUrl }}"> Download {{ $download->getCustomProperty('label') ?? $download->name }} </a> </div> @endforeach //