commit 08-2025
This commit is contained in:
parent
9ae662f63e
commit
480fdc65ed
404 changed files with 65310 additions and 2600431 deletions
74
dev/bak/routes/utility.php
Normal file
74
dev/bak/routes/utility.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Utility Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Storage, images and general utility routes that are accessible from all domains
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('storage/images/{from}/{slug}', function ($from = null, $slug = null) {
|
||||
if ($from == 'shop') {
|
||||
if ($image = \App\Models\UserShop::where('filename', $slug)->first()) {
|
||||
$path = storage_path('app/public') . '/images/shop' . '/' . $image->filename;
|
||||
if (file_exists($path)) {
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
})->name('storage_images');
|
||||
|
||||
Route::get('/product/image/{slug}', function ($slug = null) {
|
||||
if ($image = \App\Models\ProductImage::where('slug', $slug)->first()) {
|
||||
$path = storage_path('app/public') . '/images/product' . '/' . $image->product_id . '/' . $image->filename;
|
||||
if (file_exists($path)) {
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
})->name('product_image');
|
||||
|
||||
|
||||
Route::get('/iq/image/{slug}', function ($slug = null) {
|
||||
if ($image = \App\Models\IqImage::where('slug', $slug)->first()) {
|
||||
$path = storage_path('app/public') . '/images/iq_images/' . $image->filename;
|
||||
if (file_exists($path)) {
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
})->name('iq_image');
|
||||
|
||||
Route::get('/user_shop/image/{slug}', function ($slug = null) {
|
||||
if ($image = \App\Models\UserShopOnSite::where('slug', $slug)->first()) {
|
||||
$path = storage_path('app/public') . '/images/user_shop' . '/' . $image->user_shop_id . '/' . $image->filename;
|
||||
if (file_exists($path)) {
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
})->name('user_shop_image');
|
||||
|
||||
Route::get('/shop/product/image/{slug}', function ($slug = null) {
|
||||
if ($image = \App\Models\ProductImage::where('slug', $slug)->first()) {
|
||||
$path = storage_path('app/public') . '/images/product' . '/' . $image->product_id . '/' . $image->filename;
|
||||
if (file_exists($path)) {
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
})->name('shop_product_image');
|
||||
|
||||
Route::get('translation/{locale}', function ($locale) {
|
||||
\Session::put('locale', $locale);
|
||||
\App::setLocale($locale);
|
||||
if (Auth::guard('user')->check()) {
|
||||
$user = Auth::guard('user')->user();
|
||||
$user->lang = $locale;
|
||||
$user->save();
|
||||
}
|
||||
if (Auth::guard('customers')->check()) {
|
||||
$user = Auth::guard('customers')->user();
|
||||
$user->language = $locale;
|
||||
$user->save();
|
||||
}
|
||||
return redirect()->back();
|
||||
})->name('translation');
|
||||
Loading…
Add table
Add a link
Reference in a new issue