index.php?uc=bonbons
.<form action="index.php?uc=bonbons" method=post>
<input type="hidden" name="action" value="add_more">
<input type="hidden" name="choice" value="<?= $id; ?>">
<button type="submit"><img src="images/plus_cart.png" border="1" width="40" height="40"></button>
</form>
$_SESSION['panier'][$id]++;
header("Location: ".$_SERVER['REQUEST_URI']);
php /home/.../site/artisan schedule:run >>/dev/null 2>&1
storage
app
private
my-file.jpg
Route::get('/p/{filename}', function($filename){
$path = Storage::disk('private')->path($filename);
return response()->file($path);
})->name('private_images')->middleware('auth');
$fileUrl = route('private_images', ['filename' => 'my-file.jpg']);
return view('название', ['fileUrl' => $fileUrl]);
<img src="{{ $fileUrl }}" alt="">
<img src="your-site.ru/private-route/?file=2021/02/12/ksdjkfjlaksjf2sd1.jpg">
$fileUrl = "your-site.ru/private-route/?file=2021/02/12/ksdjkfjlaksjf2sd1.jpg";
return view('название', compact('fileUrl'))
Route::get('p/attach/{id}/{name}', [AttachmentController::class, 'show'])->name('attachment.show');
function private_url(Attachment $attachment)
{
return route('attachment.show', [
'id' => $attachment->id,
'name' => $attachment->original_name,
]);
}
route('attachment.show', $attachment)
, но оно не работает так. Поэтому хелпер над хелпером.